Problem with Bridging Batman(on wifi) to Ethernet (on LAN)

Hello,

I am novice to the openwrt but have got bit of luck to get the following:

  • RPI B+ used to get internet connectivity via Ethernet (br-lan)
  • RPI B+ used to get the local mesh connectivity via WiFi (bat0) using batman adv
  • RPI Zero W used to get connected in mesh mode.

Objective : The mesh node should be able to send the data over internet to some server.

I have managed to write the following following script which crates the batman network in local mesh and via DHCP, the ethernet is also also available.

Then I created a mesh bridge as suggested here : https://www.open-mesh.org/projects/batman-adv/wiki/Quick-start-guide. But my problem is, I am not able to get connectivity from the mesh node to the internet.

Important : The script is not run on the startup, it is executed manually for now.

# Activate batman-adv

 modprobe batman-adv

# Disable and configure wlan0 & br-lan

ip link set wlan0 down
ip link set br-lan down
ip link set eth0 down

#configure mesh bridge
ip link add name mesh-bridge type bridge

#Configure wlan0
ifconfig wlan0 mtu 1532
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 essid RPI_OPNWRT_Child
iwconfig wlan0 ap any
iwconfig wlan0 channel 8
#ip link set wlan0 up
ip link set up dev wlan0
sleep 1s

#Activate bat0
batctl if add wlan0

#Configure mesh bridge with bat0 and br-lan
ip link set dev bat0 master mesh-bridge
ip link set dev br-lan master mesh-bridge

sleep 1s


#bring up all the interfaces
#ifconfig bat0 up
ip link set up dev bat0
sleep 3s
#ip link set eth0 up
ip link set up dev eth0
sleep 3s
#ifconfig br-lan up
ip link set up dev br-lan
sleep 2s
#ifconfig mesh-bridge up
ip link set up dev mesh-bridge
# Use different IPv4 addresses for each device

# This is the only change necessary to the script for

# different devices. Make sure to indicate the number

# of bits used for the mask.

 #ifconfig bat0 172.27.0.1/16
 ip addr add 192.168.1.1/24 dev mesh-bridge

The output of the ifconfig command looks as under:

bat0      Link encap:Ethernet  HWaddr FA:9F:BE:F6:FF:E9  
          inet6 addr: fe80::f89f:beff:fef6:ffe9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:176 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:16 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7742 (7.5 KiB)  TX bytes:740 (740.0 B)

br-lan    Link encap:Ethernet  HWaddr B8:27:EB:37:16:86  
          inet addr:192.168.5.14  Bcast:192.168.5.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe37:1686/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5669 errors:0 dropped:0 overruns:0 frame:0
          TX packets:735 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:424694 (414.7 KiB)  TX bytes:88333 (86.2 KiB)

eth0      Link encap:Ethernet  HWaddr B8:27:EB:37:16:86  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6068 errors:0 dropped:49 overruns:0 frame:0
          TX packets:865 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:551631 (538.7 KiB)  TX bytes:104924 (102.4 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:147 errors:0 dropped:0 overruns:0 frame:0
          TX packets:147 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7665 (7.4 KiB)  TX bytes:7665 (7.4 KiB)


mesh-bridge Link encap:Ethernet  HWaddr FA:9F:BE:F6:FF:E9  
          inet addr:192.168.1.1  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::f89f:beff:fef6:ffe9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:175 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5236 (5.1 KiB)  TX bytes:1606 (1.5 KiB)

wlan0     Link encap:Ethernet  HWaddr B8:27:EB:62:43:D3  
          inet6 addr: fe80::ba27:ebff:fe62:43d3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3333 errors:0 dropped:1 overruns:0 frame:0
          TX packets:2860 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:342324 (334.3 KiB)  TX bytes:292616 (285.7 KiB)

And my /etc/config/network looks as under

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd8f:7204:f79f::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0'
        option proto 'dhcp'

config interface 'wwwww'
        option proto 'dhcp'
        option ifname '@wwwww'

Any help will be highly appreciated, if you need any further logs, please let me know. Thank you in advance for all your support and great work you guys are doing.