Posts: 4
Joined: Mon Nov 18, 2013 6:33 pm

Wi-fi + Ethernet Bridging

Sat Dec 14, 2013 7:04 am

There are many threads for people trying to get this sort of bridging and that sort of bridging. Access points, hot spots, this distro and that. I'm struggling to get my own problem to work and I find the other threads have different and conflicting information, with little explanation of the mechanics.

So unfortunately, I'll start a new thread.

Problem: I have a RPi that needs to connect to a wireless network in my home. I have another device right next to it which doesn't have wireless ability, but I can plug it into the RPi's built-in ethernet port. This is the same as many people wanting to get their TV on wi-fi...

  • I'm using bridge-utils. I hope this isn't misguided. Seems like others can get this to work.
  • I'm not particularly interested in dealing directly with iptables or ebtables or any of those.
  • I'm not bridging between two IP networks, they should all be using the same address range (10.0.0.x) and be on the same subnet.
  • I AM bridging between wi-fi and ethernet.
  • I get get the RPi up on wifi.
Notable: I can get this to work using dedicated hardware for bridging, notably an Airport Express. But this requires the Airport, a switch/hub, three power adapters, and 13 watts. If i can do this all with the RPi exclusively, then i am under 4 watts. For reasons that aren't important, I want/need this to be very low power.

Specific qustions/problems I've had with other threads:
  • Should the bridge interface get an IP itself? how is that even possible without a MAC?
  • Should the iface statements for the real interfaces be static? manual? dhcp? I'd ultimately like the addresses be dhcp assigned, but i've seen people claim to use manual and have the dhcp still assign them. I don't know how that works.
  • I fear my USB-WiFi doesn't support promiscuous mode. I get messages stating that I can't add the wlan0 interface to the bridge. Operation is not permitted. How can I check if this is supped to work? It's a TPLINK adapter with an Atheros chipset.
When I tried manually:

Code: Select all

brctl addif br0 wlan0 
can't add wlan0 to bridge br0: Operation not supported 
No better when i had it all in network/interfaces... the wlan0 just wouldn't participate.

Code: Select all

## loopback interface
auto lo
iface lo inet loopback

## wi-fi interface
auto wlan0
iface wlan0 inet manual
#  wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
  wpa-ap-scan 1
  wpa-ssid "My Lovely Network"
  wpa-psk "SuperSecretPassword"
  wpa-proto RSN
  wpa-pairwise CCMP TKIP
  wpa-group CCMP TKIP
  wpa-key-mgmt WPA-PSK

## ethernet interface
auto eth0
iface eth0 inet manual

## bridging interface betwen wi-fi and ethernet
auto br0
iface br0 inet dhcp
  bridge_ports eth0 wlan0
  bridge_stp off
  bridge_maxwait 5

  wpa-iface wlan0
  wpa-bridge br0

User avatar
Posts: 29385
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Wi-fi + Ethernet Bridging

Sat Dec 14, 2013 11:26 am

The nature of bridging interfaces is exactly the same as setting up your RPi was a wireless access point.

Here's my /etc/network/interfaces file from that experiment (eth0 was connected to the router in this case).

Code: Select all

auto lo
iface eth0 inet static
hostapd /etc/hostapd/hostapd.conf # you can probably ignore this line

auto br0
iface br0 inet static
bridge_ports eth0 wlan0
On my network, every machine that's either permanently connected or running a service gets a static address. Every other phone / laptop / tablet / kindle / Xbox / PS4 gets a DHCP address. is my ADSL gateway/router/swich. I use the range 10.1.1.[2-29] for servers. 10.1.1.[30-100] for DHCP, 10.1.1.[230-254] for NAS, WiFi AP & Printer. I'm also running a SIT 6to4 tunnel (now using Hurricane Electric) so every machine that can do IPv6 gets an IPv6 address.

You have to bridge the machine that has two interfaces (one is connected to your router, the other is free for a secondary machine to use).

It's very easy with a Windows Laptop to bridge WiFi and Ethernet. I've used that to connect my RPi with a cable.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

Return to “Troubleshooting”

Who is online

Users browsing this forum: PeterO and 54 guests