Hello!
Sorry about taking your time, but i really need some help...
First of all, sorry about my english, i will try to express the better i can. I send this need of help for you and for the others developers envolved in the batman-adv project, hoping some reply.
My name is Pedro, and i'm writing from Portugal, Oporto. I'm a student of telecomunications and i'm doing the last work to finish my master thesis. It was proposed to me in my school doing a management aplication for a batman-adv mesh network... by the way my school is ISEP - Oporto Superior Institute of Engeneering.
In this moment i'm trying to setup a basic 2 nodes using batman-adv... I'm using UBUNTU 10.10 - linux. I'm using OPENWRT in 2 routers. The routers are 2 linksys wrt54gs (v1.1 and v3). I compiled the backfire stable release from:
svn co svn://svn.openwrt.org/openwrt/branches/backfire
Here are my feeds:
src-svn packages svn://svn.openwrt.org/openwrt/branches/packages_10.03.2 svn://svn.openwrt.org/openwrt/packages src-svn luci http://svn.luci.subsignal.org/luci/branches/luci-0.10/contrib/package
I installed the kmod-batman-adv.
I attached a image with a scheme from my test configuration.
..................
When i do:
root@OpenWrt:~# batctl if br-lan: active wlan0: active
the two interfaces are active... it seems ok!
root@OpenWrt:~# batctl o [B.A.T.M.A.N. adv 2012.0.0, MainIF/MAC: br-lan/00:13:10:7c:da:71 (bat0)] Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ... 00:06:25:00:63:7b 0.412s (247) 00:06:25:00:63:7b [ wlan0]: 00:06:25:00:63:7b (247) 00:06:25:00:63:79 0.076s (246) 00:06:25:00:63:7b [ wlan0]: 00:06:25:00:63:7b (246)
the node 1 see the node 2... it seems ok!
Here is my /etc/config files for router 1, that is supossed to work as a batman-adv gateway:
root@OpenWrt:/etc/config# vi batman-adv config 'mesh' 'bat0' option 'interfaces' 'wifi lan' option 'aggregated_ogms' '1' option 'ap_isolation' '0' option 'bonding' '0' option 'fragmentation' '1' option 'gw_bandwidth' '5mbit/1024kbit' option 'gw_mode' 'server' #option 'gw_sel_class' option 'log_level' 'all' option 'orig_interval' '1000' option 'vis_mode' 'server'
after the boot when i do:
root@OpenWrt:~# batctl gw off
then i do: root@OpenWrt:~# batctl gw server 5mbit root@OpenWrt:~# batctl gw server (announced bw: 4MBit/1024KBit)
should't be necessary do "batctl gw server 5mbit"... it already is determinated in the /etc/config/batman-adv... why this happens?
also with the vis mode:
root@OpenWrt:~# batctl vm client
then i do:
root@OpenWrt:~# batctl vm server root@OpenWrt:~# batctl vm server
the same thing happens... why? ----- the gw definition and the vm definition is mandatory to router 2 access internet? or doesn't matter?
here is is my /etc/config files for router 2, that is supossed to work as a batman-adv gateway client:
root@OpenWrt:~# vi /etc/config/batman-adv config 'mesh' 'bat0' option 'interfaces' 'wifi lan' option 'aggregated_ogms' '1' option 'ap_isolation' '0' option 'bonding' '0' option 'fragmentation' '1' #option 'gw_bandwidth' option 'gw_mode' 'client' option 'gw_sel_class' '2' option 'log_level' 'all' option 'orig_interval' '1000' option 'vis_mode' 'client'
is the file ok?
when i do in node 2:
root@OpenWrt:~# batctl if br-lan: active wlan0: active
root@OpenWrt:~# batctl o [B.A.T.M.A.N. adv 2012.0.0, MainIF/MAC: br-lan/00:06:25:00:63:79 (bat0)] Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ... 00:13:10:7c:da:71 0.916s (235) 00:13:10:7c:da:73 [ wlan0]: 00:13:10:7c:da:73 (235) 00:13:10:7c:da:73 0.080s (235) 00:13:10:7c:da:73 [ wlan0]: 00:13:10:7c:da:73 (235)
it seems ok...
root@OpenWrt:~# batctl gw off doesn't seem ok...
then i do:
root@OpenWrt:~# batctl gw client 2 root@OpenWrt:~# batctl gw client (selection class: 2)
root@OpenWrt:~# batctl vm client root@OpenWrt:~# batctl vm client
the gw and vm doesn't start/boot with the start configuration... it's the same problem... why this happens? it's crucial for the batman-adv works correctly?
____________________________________________________________ _____end________________________________________________________ ____________________________________________________________
Here is my network file for router 1 and 2 ( the only difference is "lan option ipaddr" and the "wifi option ipaddr"... Question: is necessary to wifi (wlan0) have static ipaddr or it shouldn't? The mtu size is ok?
root@OpenWrt:/etc/config# vi network #### VLAN configuration config switch eth0 option enable 1
config switch_vlan eth0_0 option device "eth0" option vlan 0 option ports "1 2 3 4 5"
config switch_vlan eth0_1 option device "eth0" option vlan 1 option ports "0 5" ######## for V3 is "4 5"
#### Loopback configuration config interface loopback option ifname "lo" option proto static option ipaddr 127.0.0.1 option netmask 255.0.0.0
#### LAN configuration config interface lan option type bridge option ifname "eth0.0 bat0 wlan0" option proto static option ipaddr 10.3.1.1 #######for router 2 is 10.3.1.2 option netmask 255.255.255.0 option broadcast 10.3.1.255 option mtu 1500
#### WLAN configuration config interface wifi option proto static option ifname "wlan0" option ipaddr 10.1.1.1 ########for router 2 is 10.1.1.2 option netmask 255.255.255.0 option mtu 1528
#### WAN configuration config interface wan option ifname "eth0.1" option proto dhcp
#### BAT configuration config interface bat option ifname "bat0" option proto none option mtu 1500 ___________________________________________________ __end_________________________________________________ _____________________________________________________
Here is the dhcp file: P.S. i can access the internet through the eth0.0 (ethernet cable) both in router 1 and router 2, but i can't access through wireless (neither router 1 and router 2)... Both routers give IP through cable and trough wireless... the conections are always made, and it's possible to access using ssh both routers, doesn't matter if the connection is made by cable or by air... the difference is to access to internet... only works by cable in both routers with the scheme i attached...
Is possible to exist conflict with the IP distribution, because the "option authoritative 1"?
Is necessary to change some settings? It is necessary wifi dhcp to the wireless stations to connect? or should they manually set an static IP?
root@OpenWrt:/etc/config# vi dhcp config dnsmasq option domainneeded 1 option boguspriv 1 option filterwin2k 0 # enable for dial on demand option localise_queries 1 option rebind_protection 1 # disable if upstream must serve RFC1918 addresses option rebind_localhost 1 # enable for RBL checking and similar services #list rebind_domain example.lan # whitelist RFC1918 responses for domains option local '/lan/' option domain 'lan' option expandhosts 1 option nonegcache 0 option authoritative 1 option readethers 1 option leasefile '/tmp/dhcp.leases' option resolvfile '/tmp/resolv.conf.auto' #list server '/mycompany.local/1.2.3.4' #option nonwildcard 1 #list interface br-lan #list notinterface lo #list bogusnxdomain '64.94.110.11'
config dhcp lan option interface lan option start 51 #########for router 2 is start 101 option limit 70 #########for router 2 is limit 130 #option leasetime 12h
config dhcp wan option interface wan option ignore 1
config dhcp wifi option interface wifi option start 51 #########for router 2 is start 101 option limit 70 #########for router 2 is limit 130
_______________________________________________ ______end_______________________________________________ __________________________________________________
Here is my /etc/config/firewall:
what do you think? it's ok?
root@OpenWrt:~# vi /etc/config/firewall config defaults option syn_flood 1 option input ACCEPT option output ACCEPT option forward ACCEPT # Uncomment this line to disable ipv6 rules # option disable_ipv6 1
config zone option name lan option network 'lan' option input ACCEPT option output ACCEPT option forward ACCEPT
config zone option name wan option network 'wan' option input ACCEPT option output ACCEPT option forward ACCPET option masq 1 option mtu_fix 1
config forwarding option src lan option dest wan
config forwarding option src wan option dest lan
config forwarding option src wifi option dest wan
config forwarding option src wan option dest wifi
config forwarding option src lan option dest wifi
config forwarding option src wifi option dest lan
# We need to accept udp packets on port 68, # see https://dev.openwrt.org/ticket/4108 config rule option name Allow-DHCP-Renew option src wan option proto udp option dest_port 68 option target ACCEPT option family ipv4
# Allow IPv4 ping config rule option name Allow-Ping option src wan option proto icmp option icmp_type echo-request option family ipv4 option target ACCEPT
# Allow DHCPv6 replies # see https://dev.openwrt.org/ticket/10381 config rule option name Allow-DHCPv6 option src wan option proto udp option src_ip fe80::/10 option src_port 547 option dest_ip fe80::/10 option dest_port 546 option family ipv6 option target ACCEPT
# Allow essential incoming IPv6 ICMP traffic config rule option name Allow-ICMPv6-Input option src wan option proto icmp list icmp_type echo-request list icmp_type destination-unreachable list icmp_type packet-too-big list icmp_type time-exceeded list icmp_type bad-header list icmp_type unknown-header-type list icmp_type router-solicitation list icmp_type neighbour-solicitation option limit 1000/sec option family ipv6 option target ACCEPT
# Allow essential forwarded IPv6 ICMP traffic config rule option name Allow-ICMPv6-Forward option src wan option dest * option proto icmp list icmp_type echo-request list icmp_type destination-unreachable list icmp_type packet-too-big list icmp_type time-exceeded list icmp_type bad-header list icmp_type unknown-header-type option limit 1000/sec option family ipv6 option target ACCEPT
# include a file with users custom iptables rules config include option path /etc/firewall.user
_____________________________________ _____end_____________________________________ __________________________________________
Finally here is my /etc/config/wireless file:
I also have some questions here... Is necessary the both routers have the same BSSID? Is mandatory to have BSSID, or isn't mandatory to aggregate a batman-adv mesh network? "option network wifi" is correct or should be "option network lan"?
root@OpenWrt:/etc/config# vi wireless config wifi-device radio0 option type mac80211 option channel 6 option phy phy0 option hwmode 11g option country PT option txpower 20 option disabled 0
config wifi-iface option device radio0 option network wifi option mode adhoc option ssid PR option bssid 00:13:10:7c:da:71 option encryption none
________________________________ ______end___________________________ ___________________________________
This is it... Perhaps you don't have the time to analyze all this... I'm about two months to get this thing done... but i am not capable... I already asked to my colleagues and to my teachers, but they don't know how to... It's my job... So i decided to ask for your help, otherwise i think i don't get there only by myself... i can't find nothing concrete about these configurations anywhere...
Could you please give some light? I would be very appreciate, and of course i would refer your kindness and contribution in the greetings section of my thesis... Thank you very much. Best regards and good work. Pedro Rodrigues Portugal, Europe
Some questions here can be answered by reading the documentation section under http://www.open-mesh.org/wiki/batman-adv/ - I will not mention it in this text. Please just check it out and read about things like "gateway support" and so on.
Many, many, many things in this mail are not batman-adv related. Most of them are either OpenWRT specific or normal linux routing stuff. So I will not extensively answer to this kind of questions.
On Tuesday 01 May 2012 20:06:45 Pedro Nuno Costa Rodrigues wrote:
In this moment i'm trying to setup a basic 2 nodes using batman-adv... I'm using UBUNTU 10.10 - linux. I'm using OPENWRT in 2 routers. The routers are 2 linksys wrt54gs (v1.1 and v3).
Did you check that adhoc between both routers work without batman-adv? (bcast and unicast)
When i do:
root@OpenWrt:~# batctl if br-lan: active wlan0: active
Please don't add bridges to batman-adv unless you absolutely know what you are doing.
And never add bridges to an batman-adv interface that has the same batman-adv interface as port.
[...]
the same thing happens... why? ----- the gw definition and the vm definition is mandatory to router 2 access internet? or doesn't matter?
No, vm is for the visualization server/client configuration (i doubt that you are using it with two nodes). The gateway is only for a special dhcp handling when you have multiple dhcp servers running and want that clients use the dhcp server with the "best" connection.
here is is my /etc/config files for router 2, that is supossed to work as a batman-adv gateway client:
root@OpenWrt:~# vi /etc/config/batman-adv config 'mesh' 'bat0' option 'interfaces' 'wifi lan' option 'aggregated_ogms' '1' option 'ap_isolation' '0' option 'bonding' '0' option 'fragmentation' '1' #option 'gw_bandwidth' option 'gw_mode' 'client' option 'gw_sel_class' '2' option 'log_level' 'all' option 'orig_interval' '1000' option 'vis_mode' 'client'
is the file ok?
Propably not... see the part about "lan" bridge interface above.
when i do in node 2:
root@OpenWrt:~# batctl if br-lan: active wlan0: active
Same here.
[....]
the gw and vm doesn't start/boot with the start configuration... it's the same problem... why this happens? it's crucial for the batman-adv works correctly?
I am no OpenWRT developer, so I can't tell you anything about the startup problems in OpenWRT. But the meaning of vm and gw was explained above and is not really needed to "have internet access".
Here is my network file for router 1 and 2 ( the only difference is "lan option ipaddr" and the "wifi option ipaddr"... Question: is necessary to wifi (wlan0) have static ipaddr or it shouldn't? The mtu size is ok?
MTU is not ok because you added br-lan with the mtu 1500. The mtu of wifi should be ok.
[...]
#### LAN configuration config interface lan option type bridge option ifname "eth0.0 bat0 wlan0"
This looks like a local packet loop created by your bat0 in bridge, bridge in bat0 cycle. It is also weird that you have wlan0 as adhoc interface for batman and as client interface. Maybe you want to split it into two different ones.
One for adhoc+batman-adv and one for client access (AP mode)
[...]
root@OpenWrt:/etc/config# vi dhcp config dnsmasq option domainneeded 1 option boguspriv 1 option filterwin2k 0 # enable for dial on demand option localise_queries 1 option rebind_protection 1 # disable if upstream must serve RFC1918 addresses option rebind_localhost 1 # enable for RBL checking and similar services #list rebind_domain example.lan # whitelist RFC1918 responses for domains option local '/lan/' option domain 'lan' option expandhosts 1 option nonegcache 0 option authoritative 1 option readethers 1 option leasefile '/tmp/dhcp.leases' option resolvfile '/tmp/resolv.conf.auto' #list server '/mycompany.local/1.2.3.4' #option nonwildcard 1 #list interface br-lan #list notinterface lo #list bogusnxdomain '64.94.110.11'
config dhcp lan option interface lan option start 51 #########for router 2 is start 101 option limit 70 #########for router 2 is limit 130 #option leasetime 12h
config dhcp wan option interface wan option ignore 1
config dhcp wifi option interface wifi option start 51 #########for router 2 is start 101 option limit 70 #########for router 2 is limit 130
Why is there a special wifi configuration here? You have a br-lan config that already includes the wifi interface.
Finally here is my /etc/config/wireless file:
I also have some questions here... Is necessary the both routers have the same BSSID? Is mandatory to have BSSID, or isn't mandatory to aggregate a batman-adv mesh network?
batman-adv isn't interested in the bssid. It just needs a common broadcast domain for its ethernet frames.
The interface is in adhoc mode... this means that the bssid here is the cellid. Both nodes will only be in the same "network" when the cellids are the same.
[...]
Just my two cents. You should try to analyze parts of your setup without doing the complete setup at ones. So, check the different links, send some ping packets here and find the problematic part. Otherwise it is extreme hard to debug this thing.
Kind regards, Sven
On Tue, May 1, 2012 at 4:34 PM, Sven Eckelmann sven@narfation.org wrote:
Some questions here can be answered by reading the documentation section under http://www.open-mesh.org/wiki/batman-adv/ - I will not mention it in this text. Please just check it out and read about things like "gateway support" and so on.
In case you're still fighting with this, I've just added to the documentation some "simple configuration examples" that actually work. http://www.open-mesh.org/wiki/batman-adv/Openwrt-config-examples
While the examples are a bit more complex since it handles up to 3 radios per node, you can understand the logic in there (how is the bridge setup, and which interfaces are added to bat0) and scale it down.
Hope that helps,
On Tue, May 1, 2012 at 4:06 PM, Pedro Nuno Costa Rodrigues pedroncr@sapo.pt wrote:
#### WLAN configuration config interface wifi option proto static option ifname "wlan0" option ipaddr 10.1.1.1 ########for router 2 is 10.1.1.2 option netmask 255.255.255.0 option mtu 1528
You should never assign an IP to an interface which forms part of a bridge, or is managed by batman-adv (i.e. it was added to bat0)
that config snippet should only have ifname, mtu and proto(=none)
Cheers!
b.a.t.m.a.n@lists.open-mesh.org