Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2019-09-14,master
commit 6702401cd7f6590153435bc9b995011d34ccc074 Author: Sven Eckelmann sven@narfation.org Date: Sat Mar 9 13:39:43 2019 +0000
doc: batman-adv/Batman-adv-openwrt-config: add information how to configure batman-adv 2019.0-3 and newer
6702401cd7f6590153435bc9b995011d34ccc074 batman-adv/Batman-adv-openwrt-config.textile | 117 ++++++++++++++++++++++++++- 1 file changed, 116 insertions(+), 1 deletion(-)
diff --git a/batman-adv/Batman-adv-openwrt-config.textile b/batman-adv/Batman-adv-openwrt-config.textile index 613b7a2..6648258 100644 --- a/batman-adv/Batman-adv-openwrt-config.textile +++ b/batman-adv/Batman-adv-openwrt-config.textile @@ -6,7 +6,122 @@ This page showcases some basic batman-adv configurations on OpenWrt including wi
The configuration for the following common example is provided: One AP with a wireless adhoc interface is supposed to run batman-adv (essentially, the setup explained in our [[Quick-start-guide|Quick-start-guide]]).
-h2. Batman-adv 2013.0.0 and newer +h2. Batman-adv 2019.0-3 and newer + +With batman-adv 2019.0-3, the OpenWrt package was modified to better integrate in the netifd infrastructure. It now provides three different protos: + +* batadv_hardif +** network interface used by batadv meshif to transport the batman-adv packets +** its master interface is set to the batadv meshif +* batadv (meshif/softif) +** virtual interface that emulates a normal 802.3 interface on top +** encapsulates traffic and forwards it via the batadv hardifs +* batadv_vlan +** potential VLAN ID on top of batadv meshif +** allows filtering of traffic from specific VIDs + +The wireless configuration in '/etc/config/wireless': +<pre> +config wifi-device 'radio0' + option [..] + +config wifi-iface 'wmesh' + option device 'radio0' + option ifname 'mesh0' + option network 'bat0_hardif_mesh0' + option mode 'mesh' + option mesh_id 'mesh' + option mesh_fwding '0' + option mesh_ttl '1' + option 'mcast_rate' '24000' +</pre> + +It is assumed you configured the 'wifi-device' depending on your requirements and your hardware. The interesting part is the 'wifi-iface' stanza with its options: + +* 'device' points back to your radio (wifi-device) interface +* 'ifname' allows you to specify an arbitrary name for your adhoc/meshpoint interface +* 'network' points to the corresponding stanza in '/etc/config/network' +* 'mode' defines the wifi mode - 802.11s mesh(point) in our case +* 'mcast_rate' helps to avoid low bandwidth routes (routes with a lower throughput rate than the mcast rate will not be visible to batman-adv) +* 'mesh_id' is a basic wireless settings (like an SSID) you might want to set to your liking + +More information can be found in the "OpenWrt wireless configuration":https://wiki.openwrt.org/doc/uci/wireless + +The first step is to create the "batadv" mesh interface (in our case "bat0") in /etc/config/network with the optional list of options: + +<pre> +config interface 'bat0' + option proto 'batadv' + ## optional settings to override the defaults: + option routing_algo 'BATMAN_IV' + option aggregated_ogms 1 + option ap_isolation 0 + option bonding 0 + option fragmentation 1 + option gw_mode 'off' + #option gw_bandwidth '10000/2000' + #option gw_sel_class 20 + option log_level 0 + option orig_interval 1000 + option bridge_loop_avoidance 1 + option distributed_arp_table 1 + option multicast_mode 1 + option network_coding 0 + option hop_penalty 30 + option isolation_mark '0x00000000/0x00000000' +</pre> + +The next step is to add actual network device has "batadv_hardif" to the "bat0" +batadv meshif. This is done by specifying a "batadv_hardif" interface section +per network device. Here we add eth0 and the mesh0 (from /etc/config/wireless) +to bat0. It is important to adjust the MTU of the batadv_hardif devices +to avoid fragmentation. + +<pre> +# add *single* wifi-iface with network bat0_hardif_mesh0 as hardif to bat0 +config interface 'bat0_hardif_mesh0' + option proto 'batadv_hardif' + option master 'bat0' + option mtu '1536' + # option ifname is filled out by the wifi-iface + +# add eth0 as hardif to bat0 +config interface 'bat0_hardif_eth0' + option proto 'batadv_hardif' + option master 'bat0' + option mtu '1536' + option ifname 'eth0' +</pre> + +The "bat0" batadv meshif can then be used like any other network device. It +can be added to bridges by adding "bat0" to the list of "ifnames" of the bridge. +Or an IP can be configured using: + +<pre> +# configure IP on bat0 +config interface 'bat0_lan' + option ifname 'bat0' + option proto 'static' + option ipaddr '192.168.1.1' + option netmask '255.255.255.0' + option ip6assign '60' +</pre> + +VLAN specific options have to be configured in a separated stanza having protocol 'batadv_vlan'. + +In this particular section the user has to specify the name of the VLAN interface (that will be automatically created by netifd) and then list all the wanted options. At the moment the only available option for this section is 'ap_isolation': + +<pre> +config interface 'my_bat_vlan1' + option proto 'batadv_vlan' + option ifname 'bat0.1' + option ap_isolation '1' +</pre> + +Any VLAN specific option can still be listed in the batadv meshif configuration for 'bat0' and in that case they will affect the behaviour only for the plain mesh interface (i.e. bat0 - the untagged LAN). + + +h2. Batman-adv 2013.0.0 till 2019.0-2
With batman-adv 2013.0.0 the OpenWrt package was converted to integrate with OpenWrt's netifd system. This has some impact on the configuration but not much.