amuck-landowner

Home networking setup help. Using RaspberryPi to bridge wifi to network switch.

MannDude

Just a dude
vpsBoard Founder
Moderator
I have attempted this earlier when following a couple guides, seemingly I am an idiot and kill all networking when restarting the network service on the Pi and make it inaccessible via SSH so I re-install and try again. (Headless install) But at the risk of feeling ashamed of my ignorance of networking and for the sake of letting some vpsB gurus assist me: I beg for help.

For starters, I have WiFi access to the internet. On my workstation PC I connect to the internet via WiFi, and bridge that connection via ethernet to a 5 port switch that I have. Connected to that switch is my xBox, my RaspberryPi(s) and my DVR to a surveillance system. These items all access the internet through the switch that they are wired to. If my workstation is powered down, they have no internet access. Because my workstation is much more power hungry and loud than a simple Raspberry Pi... I'd like to relieve it of it's duty of providing internet access to other wired devices and let my Raspberry Pi do that. I understand that the Pi has limited throughput, but it's still greater than my local connection speed so the limit is not a concern.

I hope that my intentions are clear on what I am trying to accomplish so there is no confusion moving forward.

I am following the instructions here: https://wiki.debian.org/BridgeNetworkConnections#Manual_bridge_setup


On my Raspberry Pi:

After I VNC into the Pi and connect to Wifi manually (No idea how to do it via SSH, VNC is good enough for me and easier), this is my network config:


root@rpi2:~# ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:82:d4:cd
inet addr:10.42.0.69 Bcast:10.42.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1025 errors:0 dropped:0 overruns:0 frame:0
TX packets:1006 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:66704 (65.1 KiB) TX bytes:310579 (303.2 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1104 (1.0 KiB) TX bytes:1104 (1.0 KiB)

wlan0 Link encap:Ethernet HWaddr 00:1b:2f:70:55:9d
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:986 (986.0 B) TX bytes:3600 (3.5 KiB)


Code:
root@rpi2:~# ifup br0

Waiting for br0 to get ready (MAXWAIT is 32 seconds).
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/br0/b8:27:eb:82:d4:cd
Sending on   LPF/br0/b8:27:eb:82:d4:cd
Sending on   Socket/fallback
DHCPREQUEST on br0 to 255.255.255.255 port 67
DHCPACK from 10.42.0.1
bound to 10.42.0.69 -- renewal in 1793 seconds.
That kills Wifi for some reason, so reconnect to wifi again via VNC and run ifconfig again:
 


root@rpi2:~# ifconfig
br0 Link encap:Ethernet HWaddr b8:27:eb:82:d4:cd
inet addr:10.42.0.69 Bcast:10.42.0.255 Mask:255.255.255.0
inet6 addr: fe80::ba27:ebff:fe82:d4cd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1572 errors:0 dropped:0 overruns:0 frame:0
TX packets:1842 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:94696 (92.4 KiB) TX bytes:392636 (383.4 KiB)

eth0 Link encap:Ethernet HWaddr b8:27:eb:82:d4:cd
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2769 errors:0 dropped:0 overruns:0 frame:0
TX packets:3090 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:173392 (169.3 KiB) TX bytes:812627 (793.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:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1104 (1.0 KiB) TX bytes:1104 (1.0 KiB)

wlan0 Link encap:Ethernet HWaddr 00:1b:2f:70:55:9d
inet addr:192.168.1.145 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::21b:2fff:fe70:559d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:138 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7662 (7.4 KiB) TX bytes:6300 (6.1 KiB)


Ok, so now we see the bridge, see the wireless is running/active, and eth0.

 

Rasperry Pi: /etc/network/interfaces


auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

# Bridge setup
iface br0 inet dhcp
bridge_ports eth0

Okay, so the bridge is setup and is 'running', however I can't figure out how the hell to get it to actually work as I intend it to. I turn of or disconnect my workstation wireless, everything on the switch that has online access no longer will. It's not being provided by the Pi as I want it to be.



Other random info that may help:

Local Network: Starts at 10.42.0.1 (Computer, Raspberry Pis, xBox and DVR)
Wireless Network: Starts at 192.168.1.1 (I don't have access to alter anything on this end)

My workstation that is currently providing internet access to the switch is 10.42.0.1 on my local network. I can ssh into my pi at 10.42.0.69, my other pi at 10.42.0.16, etc. These IPs were just seemingly auto-assigned and not provided by myself. But that's how my local network is and I've not fussed with changing it as I haven't seen the need to.


So, what seemingly obvious thing am I missing that is preventing this from working how I want?


Thanks!
 

rds100

New Member
Verified Provider
I have not tried to fully understand your setup, but here are my 2 cents:

- Setup serial console access to the raspberry Pi, so you don't have to reinstall it every time something is botched with the networking config

- When eth0 is on a bridge, the IP address / dhcp should not be on eth0, it should be on the bridge interface.
 

MannDude

Just a dude
vpsBoard Founder
Moderator
I've just reinstalled it again.

Even with serial console I'm going to have to revert changes made and it's probably easier/faster/less frustrating to instead just start with a clean slate.

What I love about CrunchBang, LinuxMint, Ubunutu and even Debian as a desktop OS is I can complete what I want to do by literally clicking, "Share this connection with other computers".

It's literally a 2 second process.

I've installed the same network tools on Raspian that I have on my desktop hoping I'd have a GUI to just quickly get this setup so I don't have to dedicated hours to a seemingly simple task. Was following some other guide and it wanted me to enter the MAC Address and IP of every single device I want to share to. No, not doing that. Shouldn't need to do that. :p

Guess it's time for coffee. I want to get this to work tonight.
 

MannDude

Just a dude
vpsBoard Founder
Moderator
Calling it quits for the night. I can't for the life of me seem to figure out what is going wrong or what on my end is preventing this from working.

On a clean install I did:

  • Connect to Pi via VNC. Connected to WiFi.
  • Installed bridge-utils
  • Confirmed /etc/wpa_supplicant/wpa_supplicant.conf displayed the proper information. It did.
  • Modified my /etc/network/interfaces to look like as suggested here: http://www.raspberrypi.org/forums/viewtopic.php?f=91&t=17702 (scroll down, can't link to direct posts)

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

At this point people clapped and cheered, thank you, it works!

But nope, not working here. :(

Calling it quits for the evening. Going to relax now. Will mess with this more tomorrow. :p
 

drmike

100% Tier-1 Gogent
A simple wireless bridge device would give you years of value and retail therapy to reoccurring matter.  Bridging and manual network hackery isn't for humans.

Wireless bridging takes new device you buy, connects to that remote wifi, then gives you ethernet ports out the back side where you can do your business without all the hassle.

Years ago I did this with a Dlink device that didn't have the ports out back - just a single port.

People use these devices or commonly did to light up new spaces in their home/office where they needed multiple ethernet connected devices brought online.  I for instance used one in my garage and another in to connect a printer to the network.
 

fixidixi

Active Member
@Manndude:

Well I havent done anyting like it so sorry :(.

However I've needed to get net on my PI in a wifi only env so I used a crosslink cable and told my PI to use the laptops internet connection... worked like a charm :).

"not working here"

could you elaborate on that please? what is it exactly thats not working. whats in the logs?
 

Nikki

New Member
A simple wireless bridge device would give you years of value and retail therapy to reoccurring matter.  Bridging and manual network hackery isn't for humans.

Wireless bridging takes new device you buy, connects to that remote wifi, then gives you ethernet ports out the back side where you can do your business without all the hassle.

Years ago I did this with a Dlink device that didn't have the ports out back - just a single port.

People use these devices or commonly did to light up new spaces in their home/office where they needed multiple ethernet connected devices brought online.  I for instance used one in my garage and another in to connect a printer to the network.
You could also get a cheap router running dd-wrt (I believe there's some netgear or something everyone loves? I've only used WRT54Gs and an E3000.) I've done it before and it's quite reliable and easy to setup. You can even isolate your own little network from the rest of it quite easily, and have your own wireless connection behind it.
 
Last edited by a moderator:

GS-Dylan

Member
You could also get a cheap router running dd-wrt (I believe there's some netgear or something everyone loves? I've only used WRT54Gs and an E3000.) I've done it before and it's quite reliable and easy to setup. You can even isolate your own little network from the rest of it quite easily, and have your own wireless connection behind it.

I've always had great success with DDWRT and I miss by WRT54G's I have one right now but DDWRT doens't support that exact model. If your going to go that route make sure you check that DDWRT supports the exact model you have as there are many variations in each product line.
 

drmike

100% Tier-1 Gogent
I've always had great success with DDWRT and I miss by WRT54G's I have one right now but DDWRT doens't support that exact model. If your going to go that route make sure you check that DDWRT supports the exact model you have as there are many variations in each product line.
Sign me up for the Buffalo branded gear.   Good kit with dd-wrt.  Never tried bridging things with it.

I am about to drop ship Mann a wireless bridge... :)   Linux is great, but highly specialized config thing that isn't a wing it minimal adjust setup.  I am sure if someone wants to do a Debian tutorial or Raspbian to solve this, Mann will throw you some love and others will benefit from public how-to.  Just a though.
 

GS-Dylan

Member
Sign me up for the Buffalo branded gear.   Good kit with dd-wrt.  Never tried bridging things with it.

I am about to drop ship Mann a wireless bridge... :)   Linux is great, but highly specialized config thing that isn't a wing it minimal adjust setup.  I am sure if someone wants to do a Debian tutorial or Raspbian to solve this, Mann will throw you some love and others will benefit from public how-to.  Just a though.
I've never heard about that but just looked it up looks pretty neat. Might check that out some day. Do you have one yourself?
 

drmike

100% Tier-1 Gogent
Yes, I have a Buffalo WZR-HP-G300NH.  Years old now, but very reliable and pretty robust.   Packs quite a bit.

Buffalo on those and other models does dd-wrt custom version and can load default dd-wrt distros into them.
 
Top
amuck-landowner