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