]> pere.pagekite.me Git - homepage.git/blob - blog/data/2013-11-10-openwrt-tl-mr3040-mesh.txt
Generated.
[homepage.git] / blog / data / 2013-11-10-openwrt-tl-mr3040-mesh.txt
1 Title: Running TP-Link MR3040 as a batman-adv mesh node using openwrt
2 Tags: english, nuug, mesh network
3 Date: 2013-11-10 23:00
4
5 <p>Continuing my research into mesh networking, I was recommended to
6 use TP-Link 3040 and 3600 access points as mesh nodes, and the pair I
7 bought arrived on Friday. Here are my notes on how to set up the
8 MR3040 as a mesh node using
9 <a href="http://www.openwrt.org/">OpenWrt</a>.</p>
10
11 <p>I started by following the instructions on the OpenWRT wiki for
12 <a href="http://wiki.openwrt.org/toh/tp-link/tl-mr3040">TL-MR3040</a>,
13 and downloaded
14 <a href="http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin">the
15 recommended firmware image</a>
16 (openwrt-ar71xx-generic-tl-mr3040-v2-squashfs-factory.bin) and
17 uploaded it into the original web interface. The flashing went fine,
18 and the machine was available via telnet on the ethernet port. After
19 logging in and setting the root password, ssh was available and I
20 could start to set it up as a batman-adv mesh node.</p>
21
22 <p>I started off by reading the instructions from
23 <a href="http://wirelessafrica.meraka.org.za/wiki/index.php?title=Antoine's_Research">Wireless
24 Africa</a>, which had quite a lot of useful information, but
25 eventually I followed the recipe from the Open Mesh wiki for
26 <a href="http://www.open-mesh.org/projects/batman-adv/wiki/Batman-adv-openwrt-config">using
27 batman-adv on OpenWrt</a>. A small snag was the fact that the
28 <tt>opkg install kmod-batman-adv</tt> command did not work as it
29 should. The batman-adv kernel module would fail to load because its
30 dependency crc16 was not already loaded. I
31 <a href="https://dev.openwrt.org/ticket/14452">reported the bug</a> to
32 the openwrt project and hope it will be fixed soon. But the problem
33 only seem to affect initial testing of batman-adv, as configuration
34 seem to work when booting from scratch.</p>
35
36 <p>The setup is done using files in /etc/config/. I did not bridge
37 the Ethernet and mesh interfaces this time, to be able to hook up the
38 box on my local network and log into it for configuration updates.
39 The following files were changed and look like this after modifying
40 them:</p>
41
42 <p><tt>/etc/config/network</tt></p>
43
44 <pre>
45
46 config interface 'loopback'
47 option ifname 'lo'
48 option proto 'static'
49 option ipaddr '127.0.0.1'
50 option netmask '255.0.0.0'
51
52 config globals 'globals'
53 option ula_prefix 'fdbf:4c12:3fed::/48'
54
55 config interface 'lan'
56 option ifname 'eth0'
57 option type 'bridge'
58 option proto 'dhcp'
59 option ipaddr '192.168.1.1'
60 option netmask '255.255.255.0'
61 option hostname 'tl-mr3040'
62 option ip6assign '60'
63
64 config interface 'mesh'
65 option ifname 'adhoc0'
66 option mtu '1528'
67 option proto 'batadv'
68 option mesh 'bat0'
69 </pre>
70
71 <p><tt>/etc/config/wireless</tt></p>
72 <pre>
73
74 config wifi-device 'radio0'
75 option type 'mac80211'
76 option channel '11'
77 option hwmode '11ng'
78 option path 'platform/ar933x_wmac'
79 option htmode 'HT20'
80 list ht_capab 'SHORT-GI-20'
81 list ht_capab 'SHORT-GI-40'
82 list ht_capab 'RX-STBC1'
83 list ht_capab 'DSSS_CCK-40'
84 option disabled '0'
85
86 config wifi-iface 'wmesh'
87 option device 'radio0'
88 option ifname 'adhoc0'
89 option network 'mesh'
90 option encryption 'none'
91 option mode 'adhoc'
92 option bssid '02:BA:00:00:00:01'
93 option ssid 'meshfx@hackeriet'
94 </pre>
95 <p><tt>/etc/config/batman-adv</tt></p>
96 <pre>
97
98 config 'mesh' 'bat0'
99 option interfaces 'adhoc0'
100 option 'aggregated_ogms'
101 option 'ap_isolation'
102 option 'bonding'
103 option 'fragmentation'
104 option 'gw_bandwidth'
105 option 'gw_mode'
106 option 'gw_sel_class'
107 option 'log_level'
108 option 'orig_interval'
109 option 'vis_mode'
110 option 'bridge_loop_avoidance'
111 option 'distributed_arp_table'
112 option 'network_coding'
113 option 'hop_penalty'
114
115 # yet another batX instance
116 # config 'mesh' 'bat5'
117 # option 'interfaces' 'second_mesh'
118 </pre>
119
120 <p>The mesh node is now operational. I have yet to test its range,
121 but I hope it is good. I have not yet tested the TP-Link 3600 box
122 still wrapped up in plastic.</p>