grissgray
Posts: 12
Joined: Wed Mar 11, 2015 10:46 pm

Re: Pi as wireless bridge?

Mon Feb 01, 2016 11:38 pm

hi all im trying to do this since xmas did anyone get this too work

Spittualengr
Posts: 1
Joined: Wed Mar 23, 2016 3:31 pm

Re: Pi as wireless bridge?

Wed Mar 23, 2016 3:36 pm

I am struggling with this as well. Have a pi3 that I am trying to share the wlan0 to a second pi2 device over eth0.

1. I keep getting error that wlan0 can't added to the bridge br0
2. I can't get the bridge br0 to automatically create at reboot

TheRWT
Posts: 1
Joined: Wed Mar 30, 2016 4:56 pm

Re: Pi as wireless bridge?

Wed Mar 30, 2016 5:01 pm

Me too. Pi3. A updated tutorial would be helpful as i am not so great at these things. YET.

arre
Posts: 3
Joined: Fri May 27, 2016 2:28 pm

Re: Pi as wireless bridge?

Fri May 27, 2016 2:40 pm

Hi,

I successfully have two pi's connected over wifi (192.168.0.99, and 192.168.0.91), while only 1 of them has a wifi adaptor, and they just have an ethernet cable between them. I also first tried to bridge the wlan0, but ran into the error: "can't add wlan0 to bridge br0: Operation not supported". So, for whatever reason it refuses to do that (as other people seem to succeed), I switched to another method, and succeeded.

Thought I'd share my setup here:

Setup:

[ Pi1] ---(ethernet direct connection)--- [Pi2] --((wifidongle))

Pi1: eth0: 192.168.1.98 -> gw 192.168.1.97
Pi2: eth0: 192.168.1.97
wlan0: 192.168.0.91
192.168.0.99

Pi2 is connected directly to the wifi, and has the two addresses configured (.99 and .91).
Pi1 has no idea it is connected to the wifi, and just has an internal address 192.168.1.98, and has a default route to the other pi.

Clue:

The magic here, is that Pi2 actually fakes being two different devices on wlan0, and spoofs the packets that are going to 0.99 to actually to 1.98 and vice versa.

Configs:

All that is needed, is to have a network/interfaces like so:

Code: Select all

auto eth0
auto lo wlan0
iface lo inet loopback

iface eth0 inet static
 address 192.168.1.97
 netmask 255.255.255.0

allow-hotplug wlan0
iface wlan0 inet static
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    address 192.168.0.92
    netmask 255.255.255.0
    gateway 192.168.0.1

# Give it a secondary address too
iface wlan0 inet static
    address 192.168.0.99
And execute the following commands at boot:

Code: Select all

IP="192.168.0.99"
IPINT="192.168.1.98"
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s $IPINT -j SNAT --to-source $IP
iptables -t nat -A PREROUTING  -d $IP -i wlan0  -j DNAT --to-destination $IPINT
Hope this helps someone

bobomatic
Posts: 1
Joined: Thu Aug 04, 2016 6:47 pm

Re: Pi as wireless bridge?

Thu Aug 04, 2016 6:54 pm

This (and a few similar) links suggest a transparent Wifi-Eth bridge is technically impossible if there is more than one client on the ethernet side without the introduction of masquerading. Specifically, it explains why:

sudo brctl addif br0 eth0 wlan0

can't add wlan0 to bridge br0: Operation not supported

fails

http://superuser.com/questions/597834/b ... ot-working

This thread

http://serverfault.com/questions/152363 ... n0-to-eth0

explains how to set up the masquerading work-around

Bob

grissgray
Posts: 12
Joined: Wed Mar 11, 2015 10:46 pm

Re: Pi as wireless bridge?

Wed Aug 17, 2016 10:51 pm

did any one get this pi bridge too work

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Pi as wireless bridge?

Thu Aug 18, 2016 10:23 am

grissgray wrote:did any one get this pi bridge too work
As I'm sure you've read in the other posts, bridging where the wireless card is acting as a client device will never work correctly as it's a limitation of how wireless work. There are wireless bridge options but they generally require specialised devices on both ends that are designed to work together like that (e.g. Ubiquiti's air fibre product).

The only option that's guaranteed to work with the Pi is to have the pi acting as a router where it provides a different network and dhcp to the wired side (and potentially NAT as well).

Return to “Beginners”