I am using Raspberry Pi using Raspbian which is just Debian.

I would like to bridge from the primary WiFi network router that connects to Cox Cable to my cabled router here for my subnet to have reliable internet access.

It needs to be a WiFi-to-Ethernet bridge.

I have set /etc/networks for a static address for the USB wlan1 with the external adapter and hi-gain antenna. wpa_supplicant is configured to log in to the master router properly.

So right now it is set up so I can login to the proper network with the password, on external wlan1. Static address is set in /etc/networks. Gateway and nameserver are OK. I can browse web pages, etc.

The missing link is to bridge this to the eth0 port so my router can connect also, to provide service to my subnet.

No need for any extra network services like routing or nat or dhcp, etc. Just a simple bridge.

Can anyone please point me in the right direction to make this happen?

Thank you in advance for any help.

  • Did you try a very basic bridge by setting no IP on your Ethernet device, creating a bridge with brctl addbr br0, adding both devices to the bridge with brctl addif br0 device, and then setting your original Ethernet address and route on br0? – Julie Pelletier May 6 '17 at 0:35
  • You have not documented how your wlan0 is configured atm. – Rui F Ribeiro May 6 '17 at 8:42
  • Good point. I added some edits to clarify. I like your answer below. It is precisely the opposite of what I am trying to do, but that's OK because I think it is enough information to get me moving. Thank you for posting it. – SDsolar May 6 '17 at 17:25
  • Found this one and the first answer is funny. 'too broadly correct' - so this bridging stuff apparently requires magic, also. unix.stackexchange.com/questions/272146/… – SDsolar May 8 '17 at 23:13
  • Update from the future (late 2018): Since 2.6.33, you can't bridge wlan to eth. You can bridge wlan to eth only if you switched then wlan0 into 4addr mode. Not all drivers support that. You can read more about it here. – peterh 15 hours ago
up vote 5 down vote accepted

For configuring a bridge from ethernet to wifi, it is as simple as doing in your /etc/network/interfaces:

auto eth0
allow-hotplug eth0
iface eth0 inet manual

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual

auto br0
iface br0 inet static
bridge_ports eth0 wlan0
    address 192.168.1.100
    netmask 255.255.255.0

Replace the IP address with something more appropriate to your network.

If you prefer the IP attribution done via DHCP, change it to:

auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0

After changing /etc/network/interfaces, either restarting Debian or doing

service networking restart

Will activate this configuration.

You will have to make sure for this configuration to have bridge-utils installed. You can install it with:

sudo apt install bridge-utils

For more information, see:

BRIDGE-UTILS-INTERFACES

The wlan0 interface also has to be condigured to connect to your remote AP so this configuration is not be used verbatim.

Additional note: bridging eth0 and wlan0 together means in poor layman´s terms that br0 will present itself as a single logical interface englobing the interfaces that make part of the bridge. Usually such configuration is made when both extend or belong to the same network.

  • It is not actually the opposite; if you want wifi clients to connect to the raspberry you need hostapd on top of this configuration; I actually have an openwrt that has been configured here to do what you are asking – Rui F Ribeiro May 6 '17 at 17:50
  • It is simpler than, it is a matter of configuring the wpa_supplicant – Rui F Ribeiro May 6 '17 at 19:54
  • OK. Right now it is set up so I can login to the proper network with the password, on external wlan1. Static address is set in /etc/networks. Gateway and nameserver are OK. It logs in to the router perfectly. I can browse web pages, etc. The missing link is to bridge this to the eth0 port so my router can connect also. – SDsolar May 7 '17 at 20:11
  • 1
    I'm a little bit confused. If I try your setup and do sudo ifup -a I get the error message can't add wlan0 to bridge br0: Operation not supported. This was widely discussed with Bridging wlan0 to eth0. What I'm missing with your setup? – Ingo Feb 28 at 20:00
  • @Ingo I advise opening a new question. – Rui F Ribeiro Feb 28 at 20:08

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.