Cant set up a bridge between BATMAN-adv mesh network and pc

235 views Asked by At

I am trying to set up a bridge between my BATMAN-adv mesh network running on Raspi4's and my pc.

Ive tried a couple of different tutorials but all of them result in the same end result, no working bridge. I cant find the problem with how i set it up.

This is the script i use to configure the mesh network:


bash service wpa_supplicant stop sudo systemctl mask wpa_supplicant.service sudo update-rc.d dhcpcd disable

ip link set wlan0 down #e.g. <if> = wlan0
iw wlan0 set type ibss
ifconfig wlan0 mtu 1500 # This is necessary for batman-adv
iwconfig wlan0 channel 3
ip link set wlan0 up
iw wlan0 ibss join swarmbots 2432 # e.g. <ssid> = my-mesh-network
#Frequency is 2.432. 0.0x should match with channel.

modprobe batman-adv
batctl if add wlan0 # e.g. <if> = wlan0
ip link set up dev wlan0
ip link set up dev bat0
sudo batctl gw_mode client

I found a couple of different ways to set up a bridge, listed here: These would be executed after i configured the device on the mesh network

sudo batctl gw_mode server
ip link add name mesh-bridge type bridge
ip link set dev eth0 master mesh-bridge
ip link set dev bat0 master mesh-bridge
ip link set up dev eth0
ip link set up dev bat0
ip link set up dev mesh-bridge
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o bat0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i bat0 -o eth0 -j ACCEPT
sudo batctl gw_mode server

And the 3th try:

sudo batctl gw_mode server
sudo brctl addbr br0
sudo brctl addif eth0
sudo brctl addif bat0

Anybody able to help me out?

Thanks

0

There are 0 answers