Skip to contentSkip to conversation

Unable to connect to internet

B.A.T.M.A.N. marco tozzini 4 participants 10 messages Mar 11, 2009 – Mar 16, 2009

lore
Share & tools
lore
#0 lore raw

Hi All,
I have 2 fonera router running openwrt and batman
wireless IP are 192.168.2.200 and 192.168.2.203

Routers have separete wifi and eth interfaces

Here it is openwrt network config file:

root@OpenWrt:~# cat /etc/config/network
config 'interface' 'loopback'
       option 'ifname' 'lo'
       option 'proto' 'static'
       option 'ipaddr' '127.0.0.1'
       option 'netmask' '255.0.0.0'

config 'interface' 'lan'
option 'ifname' 'eth0'
option 'type' 'bridge'
option 'proto' 'static'
option 'ifname' 'eth0'
option 'ipaddr' '192.168.0.203'
option 'netmask' '255.255.255.0'
option 'gateway' '192.168.0.1'
option 'dns' '192.168.0.1'

config 'interface' 'wifi'
option 'ifname' 'ath0'
option 'proto' 'static'
option 'ipaddr' '192.168.2.203'
option 'netmask' '255.255.255.0'

other router has br-lan 192.168.1.200 and 192.168.0.200

router 192.168.2.203 is connected to my ADSL modem (IP 192.168.0.1) through ethernet port (br-lan in openwrt) I would like to connect to internet (and at least to ADSL modem) but something doesn't work...

I used this command on node 200:

root@OpenWrt:~# batmand ath0

I used this command on node 203:

root@OpenWrt:~# batmand -a 192.168.0.1/24 ath0
Interface activated: ath0
Using interface ath0 with address 192.168.2.203 and broadcast address 192.168.2.255

Here it is result from ping command issued from node 200

root@OpenWrt:~# ping -c 3 192.168.2.203
PING 192.168.2.203 (192.168.2.203): 56 data bytes
64 bytes from 192.168.2.203: seq=0 ttl=64 time=3.539 ms
64 bytes from 192.168.2.203: seq=1 ttl=64 time=2.875 ms
64 bytes from 192.168.2.203: seq=2 ttl=64 time=6.233 ms

--- 192.168.2.203 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 2.875/4.215/6.233 ms

root@OpenWrt:~# ping -c 3 192.168.0.203
PING 192.168.0.203 (192.168.0.203): 56 data bytes
64 bytes from 192.168.0.203: seq=0 ttl=64 time=4.981 ms
64 bytes from 192.168.0.203: seq=1 ttl=64 time=2.991 ms
64 bytes from 192.168.0.203: seq=2 ttl=64 time=3.119 ms

--- 192.168.0.203 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 2.991/3.697/4.981 ms

root@OpenWrt:~# ping -c 3 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes

--- 192.168.0.1 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss

root@OpenWrt:~# ssh [email protected]
[email protected]'s password:

BusyBox v1.11.2 (2008-10-07 13:44:59 UTC) built-in shell (ash) Enter 'help' for a list of built-in commands.

_______ ________ __

|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
         |__| W I R E L E S S   F R E E D O M
KAMIKAZE (8.09, r13118) ----------------------------
 * 10 oz Vodka       Shake well with ice and strain
 * 10 oz Triple sec  mixture into 10 shot glasses.
 * 10 oz lime juice  Salute!
---------------------------------------------------
root@OpenWrt:~# ping -c 3 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
64 bytes from 192.168.0.1: seq=0 ttl=255 time=4.106 ms
64 bytes from 192.168.0.1: seq=1 ttl=255 time=2.193 ms
64 bytes from 192.168.0.1: seq=2 ttl=255 time=2.187 ms

--- 192.168.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 2.187/2.828/4.106 ms root@OpenWrt:~#

As you can see from node 200 I can ping node 203 (wireless interface 192.168.2.203 and wired interface 192.168.0.203), but I'm unable to go through adsl modem (192.168.0.1) But I can connect to adsl modem from node 203

Any Hints?

Thanks

Ciao
Marco

#1 lore raw

Hi .

Quoted 1 line

Any Hints?

sure: You are not announcing a default route.

On mesh router connected to ADSL:

batmand -g 1000 ath0

On other mesh router:

batmand -r 1 ath0

You have to NAT towards the internet on the gateway.

Cheers,
elektra

#2 lore raw
Quoted 12 lines · elektra

Hi .

Quoted 2 lines

Any Hints?

sure: You are not announcing a default route.

On mesh router connected to ADSL:

batmand -g 1000 ath0

Quoted 9 lines

On other mesh router:

batmand -r 1 ath0

You have to NAT towards the internet on the gateway.

Cheers,
elektra

Thank you for your help
It still doesn't work
But something I can't understand happened

root@OpenWrt:~# batmand -a 192.168.0.1/24 -g 1000 -d 3 ath0
WARNING: You are using the unstable batman branch. If you are interested in *using* batman get the latest stable release !
Interface activated: ath0
Using interface ath0 with address 192.168.2.200 and broadcast address 192.168.2.255
B.A.T.M.A.N. 0.3-beta (compatibility version 5)
Warning - batgat kernel modul interface (/dev/batgat) not usable: No such file or directory
This may decrease the performance of batman!
debug level: 3
gateway class: 33 -> propagating: 1024KBit/256KBit
Adding throw route to 192.168.0.0/24 via 0.0.0.0 (table 65 - unknown)
Adding throw route to 192.168.0.0/24 via 0.0.0.0 (table 66 - unknown)
Adding throw route to 192.168.0.0/24 via 0.0.0.0 (table 67 - unknown)
Adding throw route to 192.168.0.0/24 via 0.0.0.0 (table 68 - unknown)
Adding route to 169.254.0.0/16 via 0.0.0.0 (table 254 - gate0)
Adding route to 192.168.2.203 via 0.0.0.0 (table 66 - ath0)
root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 ath0
192.168.0.0     *               255.255.255.0   U     0      0        0 br-lan
169.254.0.0     *               255.255.0.0     U     0      0        0 gate0
default         www.routerlogin 0.0.0.0         UG    0      0        0 br-lan
root@OpenWrt:~#

It seems batman set a gate0 interface with 169.254.x.x IP address How can I use this one with my 192.168.0.1 ADSL router?

Thanks

Ciao
Marco

#3 lore raw

Hi,

Quoted 7 lines
root@OpenWrt:~# batmand -a 192.168.0.1/24 -g 1000 -d 3 ath0
WARNING: You are using the unstable batman branch. If you are interested
in *using* batman get the latest stable release !
Interface activated: ath0
Using interface ath0 with address 192.168.2.200 and broadcast address
192.168.2.255
B.A.T.M.A.N. 0.3-beta (compatibility version 5)

are you using the latest version ? Elektra reported a bug if you use the latest version together with the "-a" option. As a result the node that runs with that option enabled does not see any neighbours. Can you confirm that ?

Quoted 2 lines

It seems batman set a gate0 interface with 169.254.x.x IP address How can I use this one with my 192.168.0.1 ADSL router?

You can safely ignore the 169.254.x.x addresses. Batman uses that for its internal tunneling mechanism which should not concern you. Does your setup work now or not ?

Regards,
Marek

#4 lore raw

Hi Marek

Quoted 12 lines · Marek Lindner

Hi,

Quoted 8 lines
root@OpenWrt:~# batmand -a 192.168.0.1/24 -g 1000 -d 3 ath0
WARNING: You are using the unstable batman branch. If you are interested
in *using* batman get the latest stable release !
Interface activated: ath0
Using interface ath0 with address 192.168.2.200 and broadcast address
192.168.2.255
B.A.T.M.A.N. 0.3-beta (compatibility version 5)
Quoted 4 lines

are you using the latest version ? Elektra reported a bug if you use the latest version together with the "-a" option. As a result the node that runs with that option enabled does not see any neighbours. Can you confirm that ?

No idea it's the version available from Openwrt kamikaze 8.09 batmand -v reports on my fonera v2 (192.168.0.200):

root@OpenWrt:~# batmand -c -v
WARNING: You are using the unstable batman branch. If you are interested in *using* batman get the latest stable release !
B.A.T.M.A.N. 0.3-beta (compatibility version 5)

batmand -v reports on my fonera v1 (192.168.0.203):

root@OpenWrt:~# batmand -c -v
B.A.T.M.A.N. 0.3.1 rv1206 (compatibility version 5)

Do you think this mix is not good?

If you mean batman node as neighbor the answer is:
I can see batman neighbors
I can't see node on my wired network (adsl route 192.168.0.1, other openwrt station 192.168.0.80)

Quoted 8 lines
Quoted 3 lines

It seems batman set a gate0 interface with 169.254.x.x IP address How can I use this one with my 192.168.0.1 ADSL router?

You can safely ignore the 169.254.x.x addresses. Batman uses that for its internal tunneling mechanism which should not concern you. Does your setup work now or not ?

Thank you so much for this info
AFAIK there is no such information anywhere

My system is still not working
Any hints for debug or throubleshoot?

Ciao
Marco

#5 lore raw
Quoted 6 lines · On Saturday 14 March 2009 16:13:13 marco tozzini wrote:

No idea it's the version available from Openwrt kamikaze 8.09 batmand -v reports on my fonera v2 (192.168.0.200):
B.A.T.M.A.N. 0.3-beta (compatibility version 5)

batmand -v reports on my fonera v1 (192.168.0.203):
B.A.T.M.A.N. 0.3.1 rv1206 (compatibility version 5)

The 0.3.1 is good but please don't use the 0.3-beta in a production environment! The 0.3 contained several bugs thats why we had the 0.3.1 release. Consider upgrading to the latest stable release (0.3.1 at the moment).

Regards,
Marek

#6 lore raw
In reply to marco tozzini
Quoted 51 lines · marco tozzini
Quoted 12 lines · elektra

Hi .

Quoted 2 lines

Any Hints?

sure: You are not announcing a default route.

On mesh router connected to ADSL:

batmand -g 1000 ath0

Quoted 8 lines

On other mesh router:

batmand -r 1 ath0

You have to NAT towards the internet on the gateway.

Cheers,
elektra

Thank you for your help
It still doesn't work
But something I can't understand happened

root@OpenWrt:~# batmand -a 192.168.0.1/24 -g 1000 -d 3 ath0
WARNING: You are using the unstable batman branch. If you are interested in *using* batman get the latest stable release !
Interface activated: ath0
Using interface ath0 with address 192.168.2.200 and broadcast address 192.168.2.255
B.A.T.M.A.N. 0.3-beta (compatibility version 5)
Warning - batgat kernel modul interface (/dev/batgat) not usable: No such file or directory
This may decrease the performance of batman!
debug level: 3
gateway class: 33 -> propagating: 1024KBit/256KBit
Adding throw route to 192.168.0.0/24 via 0.0.0.0 (table 65 - unknown)
Adding throw route to 192.168.0.0/24 via 0.0.0.0 (table 66 - unknown)
Adding throw route to 192.168.0.0/24 via 0.0.0.0 (table 67 - unknown)
Adding throw route to 192.168.0.0/24 via 0.0.0.0 (table 68 - unknown)
Adding route to 169.254.0.0/16 via 0.0.0.0 (table 254 - gate0)
Adding route to 192.168.2.203 via 0.0.0.0 (table 66 - ath0)
root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 ath0
192.168.0.0     *               255.255.255.0   U     0      0        0 br-lan
169.254.0.0     *               255.255.0.0     U     0      0        0 gate0
default         www.routerlogin 0.0.0.0         UG    0      0        0 br-lan
root@OpenWrt:~#
Quoted 8 lines

It seems batman set a gate0 interface with 169.254.x.x IP address How can I use this one with my 192.168.0.1 ADSL router?

Thanks

Ciao
Marco

Sorry my fault here
I swapped the 2 routers since my first post
so the dump above is related to:
192.168.0.200 connected to ADSL modem
192.168.0.203 is not just a batman node

Ciao
Marco

#7 lore raw
In reply to elektra
Quoted 12 lines · elektra

Hi .

Quoted 2 lines

Any Hints?

sure: You are not announcing a default route.

On mesh router connected to ADSL:

batmand -g 1000 ath0

Quoted 9 lines

On other mesh router:

batmand -r 1 ath0

You have to NAT towards the internet on the gateway.

Cheers,
elektra

After this hint I have
node 203 = batman node not connect to internet
node 200 = batman node gateway connect to wired lan and internet

Quoted 1 line

From the batman node client 203 (not connected to internet)

root@OpenWrt:~# ping -c 2 192.168.2.200 (= ath0)
PING 192.168.2.200 (192.168.2.200): 56 data bytes
64 bytes from 192.168.2.200: seq=0 ttl=64 time=3.330 ms
64 bytes from 192.168.2.200: seq=1 ttl=64 time=2.902 ms
--- 192.168.2.200 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 2.902/3.116/3.330 ms
root@OpenWrt:~# ping -c 2 192.168.0.200 (= br-lan)
PING 192.168.0.200 (192.168.0.200): 56 data bytes
64 bytes from 192.168.0.200: seq=0 ttl=64 time=4.780 ms
64 bytes from 192.168.0.200: seq=1 ttl=64 time=2.944 ms
--- 192.168.0.200 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 2.944/3.862/4.780 ms
root@OpenWrt:~# ping -c 2 192.168.0.1 (= router ADSL)
PING 192.168.0.1 (192.168.0.1): 56 data bytes
--- 192.168.0.1 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
root@OpenWrt:~# ping -c 2 192.168.0.80 (= other openwrt station connected through lan cable)
PING 192.168.0.80 (192.168.0.80): 56 data bytes
--- 192.168.0.80 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss

further; from GATEWAY batman node 200 (connected to wired lan and internet) I can ping everything

So this means:

From the CLIENT batman node 203 (not connected to wired lan and internet)
I can ping wireless interface of the batman node connected to wired lan
I can ping br-lan wired interface of the batman node connected to wired lan (so I think routing exist) I CAN'T ping other nodes seen by br-lan wired interface of the batman node connected to wired lan

I suspect the problem could be elsewhere batman, isn't it?

thanks
Marco

#8 lore raw

Hi!

Quoted 9 lines
Quoted 9 lines

On mesh router connected to ADSL:

batmand -g 1000 ath0

On other mesh router:

batmand -r 1 ath0

You have to NAT towards the internet on the gateway.

There is a bug in batmand in current 0.3.2 code, which occurs when you use HNA (-a). We are currently working on it. You don't need to use -a to connect to the internet in your case, however. But you have to set up simple NAT towards the interface of the batman-gateway connected to the ADSL modem.

If that interface is eth0 the command would be:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Cheers,
elektra

#9 lore raw
In reply to marco tozzini

On Wednesday 11 March 2009 21:57:34 marco tozzini wrote:
[...]

Quoted 4 lines

As you can see from node 200 I can ping node 203 (wireless interface 192.168.2.203 and wired interface 192.168.0.203), but I'm unable to go through adsl modem (192.168.0.1)
But I can connect to adsl modem from node 203

Solution was found today on irc. Marco hadn't setup a NAT on the gateway node as described in paragraph 4.2 " Why I can’t connect to the Internet after setting the default gateway?" in
http://downloads.open-mesh.net/batman/misc/batmand_howto.pdf

A different solution was suggested by Simon to set the route to 192.168.2.x nodes on 192.168.0.x nodes over the gateway node. This way the 192.168.0.x can send answer packets to 192.168.2.x when it receives packets from 192.168.2.x nodes without a NAT between the networks. 192.168.2.x could send to 192.168.0.x because the batman gateway node announced it to batman gateway clients, but packets in the other direction never found their way because the batman gateway doesn't announce a backward route to the 192.168.2.x nodes outside the mesh. This wasn't due to a fault of batmand, but a misunderstanding what the -a option does and what batmand cannot do (set routing informations on nodes outside the mesh).

Regards,
Sven