SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Mon Apr 29, 2013 4:15 am

Yep, was messing around with it all weekend.
Either, I couldn't get bridge up with both eth0 and wlan0, or when I could, it wouldn't get an IP address.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

dodu
Posts: 18
Joined: Thu Oct 11, 2012 7:38 am
Location: Germany

Re: Pi as wireless bridge?

Mon Apr 29, 2013 9:37 am

I'am using a
Tenda W311MI Wireless N150 Pico USB Adapter <-- Didn't work
now I'am using
Digitus Wireless N150 USB Adapter DN-7043 <-- Works with ebtables.

With tenda i couldn't perform adding wlan0 to br0.
With Digitus its possible.

It would be also nice to get rid of the ebtable entrys but, i have no idea.

Currently i perform a script which loades the ebtables atomic file after startup.
This only works if the ip and mac of the device on the eth0 port doesn't change.

The setup is identical to timb's guid.

With addition of:
http://wiki.debian.org/BridgeNetworkConnections

Code: Select all

 # ebtables -t nat -A POSTROUTING -o wlan0 -j snat --to-src $MAC_OF_BRIDGE --snat-arp --snat-target ACCEPT
 # ebtables -t nat -A PREROUTING -p IPv4 -i wlan0 --ip-dst $IP -j dnat --to-dst $MAC --dnat-target ACCEPT
 # ebtables -t nat -A PREROUTING -p ARP -i wlan0 --arp-ip-dst $IP -j dnat --to-dst $MAC --dnat-target ACCEPT
to save the ebtables:

Code: Select all

 # EBTABLES_ATOMIC_FILE=/root/ebtables-atomic ebtables -t nat --atomic-save
After every boot:

Code: Select all

 # EBTABLES_ATOMIC_FILE=/root/ebtables-atomic ebtables -t nat --atomic-commit

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Tue Apr 30, 2013 3:49 am

It would help to post the chipsets used in those adapters.

Edit - Looks like my cheapy RT5370s won't do bridging at all...
dodu can you please run 'iw list' and paste the output
I'm interested specifically in the "Supported interface modes" and "software interface modes" sections, but the whole output will still be useful
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Tue Apr 30, 2013 5:19 pm

Also just for reference, after running the command

Code: Select all

iw dev wlan0 set 4addr on
I was unable to get an IP address.
http://askubuntu.com/questions/155041/b ... option-why <-- that post seems to explain why, but the RT5370 sticks I have can't do what that post specifies unfortunately
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

dodu
Posts: 18
Joined: Thu Oct 11, 2012 7:38 am
Location: Germany

Re: Pi as wireless bridge?

Thu May 02, 2013 10:50 am

sure ill post it when I'am back home this evening.

dodu
Posts: 18
Joined: Thu Oct 11, 2012 7:38 am
Location: Germany

Re: Pi as wireless bridge?

Thu May 02, 2013 4:02 pm

iw list doesnt exist. iwlist nothing useful

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Fri May 03, 2013 4:12 am

You'll need to install iw then

Also, what chipsets do your sticks have ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

dodu
Posts: 18
Joined: Thu Oct 11, 2012 7:38 am
Location: Germany

Re: Pi as wireless bridge?

Fri May 03, 2013 6:47 am

Tenda pico 150n which doesn't work has Ralink RT5370 chipset.
Digitus DN-7043-3 which works Realtek RTL8188SU.

I'll install iw as soon as I'am back on my Pi :)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Fri May 03, 2013 7:11 am

Thanks!
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

macey
Posts: 58
Joined: Thu May 24, 2012 6:05 pm

Re: Pi as wireless bridge?

Mon May 06, 2013 4:50 pm

can anyone here help me with this please?
It would appear that my bridge is ok apart from I get no internet connectivity from eth0.
I have an ip on eth0 (10.0.48.1)
.
Can access RasPi from WiFi ok.

Code: Select all

brctl show
bridge name	bridge id		STP enabled	interfaces
br0		8000.801f0282bcc2	no		eth0
							wlan0

Code: Select all

ifconfig 
br0       Link encap:Ethernet  HWaddr 80:1f:02:82:bc:c2  
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::821f:2ff:fe82:bcc2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:202473 errors:0 dropped:0 overruns:0 frame:0
          TX packets:202693 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:24581243 (23.4 MiB)  TX bytes:29598510 (28.2 MiB)

eth0      Link encap:Ethernet  HWaddr b8:27:eb:f5:af:ce  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:197 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:15945 (15.5 KiB)  TX bytes:2593 (2.5 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:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 80:1f:02:82:bc:c2  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:202277 errors:0 dropped:202460 overruns:0 frame:0
          TX packets:202887 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:34679086 (33.0 MiB)  TX bytes:35297623 (33.6 MiB)
Maybe I need ebtables?

Help much appreciated.
I am using Edimax Nova WiFi dongle.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Tue May 07, 2013 12:51 am

Rather than say what wireless dongle you have, it's more helpful to say what chipset the dongle uses inside as that's more relevant.
Can you paste your /etc/network/interfaces file so that we can see your config ?
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

macey
Posts: 58
Joined: Thu May 24, 2012 6:05 pm

Re: Pi as wireless bridge?

Tue May 07, 2013 9:17 am

Hello, here is my /etc/network/interfaces file:-

Code: Select all

cat /etc/network/interfaces
auto lo

iface lo inet loopback

iface eth0 inet manual

auto wlan0
iface wlan0 inet manual

auto br0
iface br0 inet dhcp
      bridge_ports wlan0 eth0
      bridge_stp off
      bridge_maxwait 5

wpa-iface wlan0
wpa-bridge br0
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
How do I find out my "Chipset"? Done a search on Internet, no results.
Thanks in anticipation.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Tue May 07, 2013 9:20 am

Paste the output of 'lsusb'
that will tell us which chipset you have
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

macey
Posts: 58
Joined: Thu May 24, 2012 6:05 pm

Re: Pi as wireless bridge?

Tue May 07, 2013 10:15 am

ok here is the lsusb output:-

Code: Select all

lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Tue May 14, 2013 3:35 pm

I managed to get my rt5370 added to a bridge now at least, but unable to get any traffic to the computer on the ethernet port behind the Pi =/

Edit- just trying to get dhcp working at the moment but no go.
DHCP packets get sent from computer behind PI, gets forwarded over WiFi, hits the DHCP server on the wifi access point, but then the reply just disappears =/
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Wed May 15, 2013 3:22 pm

Ah ha !
Had to install dhcp-relay to get the dhcp packets properly relayed.
Now my pibridge is complete !
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Pi as wireless bridge?

Wed May 15, 2013 3:28 pm

SirLagz wrote:Ah ha !
Had to install dhcp-relay to get the dhcp packets properly relayed.
Now my pibridge is complete !
Interesting. I played around with "bridging" on both the Pi and another SBC, with no luck.
It always seemed like something was missing - some piece that none of the tuts happened to mention. This (dhcp-relay) may be it - the missing piece.

But, I have to ask, is there any particular reason to do it this way - using "bridging"? Why not do it the normal way - with iptables and another, separate network? That's the way I ended up doing it.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Wed May 15, 2013 3:40 pm

Because there's already 2 NATs in front of this network, don't need another one haha
Really though, it was mainly an exercise in being able to do it.

In case you're wondering, the configuration of the resulting network was this

Internet => Modem (Bridged) [Network 1] => Router (Linux box) [network 2] => ethernet => Pi 1 (router and AP) [network 3] => WiFi => Pi 2 => Ethernet => PC

That Pi 2 and PC would've been behind 2 different NATs already. Though in normal day to day use it shouldn't be an issue, it makes the network more complicated.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Pi as wireless bridge?

Wed May 15, 2013 3:45 pm

I agree. Thanks for the reply.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Wed May 15, 2013 3:47 pm

Joe Schmoe wrote:I agree. Thanks for the reply.
You're welcome :)

Time to update my blog, haven't done that in a while haha
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Sun May 19, 2013 3:55 pm

SirLagz wrote:Ah ha !
Had to install dhcp-relay to get the dhcp packets properly relayed.
Now my pibridge is complete !
Or not =/
DHCP works but nothing else. dagnabbit.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Pi as wireless bridge?

Sun May 19, 2013 3:57 pm

I see. So, you don't yet have an actual working "Pi as bridge" system, yet.

So, that's why the iptables/NAT solution may still be the only that actually works...
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Sun May 19, 2013 6:12 pm

Joe Schmoe wrote:I see. So, you don't yet have an actual working "Pi as bridge" system, yet.

So, that's why the iptables/NAT solution may still be the only that actually works...
No, unfortunately not.
I'm trying though haha.
I got the ARP requests forwarded for a little while...then rebooted the Pi and it's buggered again lol
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

razza30
Posts: 8
Joined: Fri Jul 26, 2013 10:01 pm

Re: Pi as wireless bridge?

Sun Jul 28, 2013 12:05 pm

I followed the guide here: http://sirlagz.net/2013/05/16/how-to-us ... -a-bridge/
And configured /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf as per gabeblack post in this thread at Fri Dec 28, 2012 11:13 pm. Here: http://www.raspberrypi.org/phpBB3/viewt ... 82#p244329

The pi connects over wireless and creates a bridge. I can ssh to the pi using that address. The pc connected to the eth0 port DOES obtain an IP address through the pi bridge (from a separate DHCP server on my network), however no other traffic (pings/http) seems to work. Any advice?

Bridge status:

Code: Select all

pi@raspberrypi /etc $ sudo brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.000f541594e4       no              eth0
                                                        ra0
Interface status:

Code: Select all

pi@raspberrypi /etc $ ifconfig
br0       Link encap:Ethernet  HWaddr 00:0f:54:15:94:e4
          inet addr:192.168.10.245  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::20f:54ff:fe15:94e4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4529 errors:0 dropped:0 overruns:0 frame:0
          TX packets:447 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:351512 (343.2 KiB)  TX bytes:52307 (51.0 KiB)

eth0      Link encap:Ethernet  HWaddr b8:27:eb:19:2b:11
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2232 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2021 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:148088 (144.6 KiB)  TX bytes:367057 (358.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:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ra0       Link encap:Ethernet  HWaddr 00:0f:54:15:94:e4
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2417742 (2.3 MiB)  TX bytes:290076 (283.2 KiB)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Pi as wireless bridge?

Mon Jul 29, 2013 12:23 pm

I haven't gotten much further than that either unfortunately.
I can get it to get an IP address, but I think I'll probably need to setup ebtables to go any further.
I currently don't have the time to try it out though :(
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Return to “Beginners”