Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When running Windows I was able to bridge my wifi connect through my laptops Ethernet connection so a range of ethernet only devices could piggy back off my wifi (Raspberry Pi, Xbox etc etc). I am now trying to do the same within Ubuntu, i.e the set up would be:

Wireless Router ---> Wifi on laptop ---> bridge to Ethernet ---> Device that needs internet plugged into Ethernet port

Now I have been trying to get this working in Ubuntu using brctl

I used the below command:

sudo brctl addif br0 eth0 wlan0

And get the following error:

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

I am hoping someone can help as I refuse to believe something I can do in windows very easily can't be done in Linux.

If you need any more info do let me know. Thanks

share|improve this question
Very similar Problem handled in [… – Legionair May 20 '13 at 22:11

This cannot be done. You cannot bridge a WiFi client connection. If you could, we wouldn't need WDS, we'd just bridge.

The problem is very simple -- an access point is prohibited by the WiFi specifaction from broadcasting traffic over the WiFi network unless something authorizes that transmission. This is largely a relic from the days when WiFi networks were very slow and had poor, if any, security.

The bridge only has a client connection to the access point. This only authorizes the access point to transmit traffic bound for the bridge. Because any machines connected to the bridge are not clients of the access point, the access point has no reason to send traffic bound for them over the WiFi link. So it will not do so.

Unfortunately, WiFi is enough like Ethernet that it's easy to expect it to act like Ethernet. But it's just different enough to bite you.

WDS configuration is a specific authorization for an access point to send traffic not bound for any of its clients. When both ends support WDS, they include the address of the bridging endpoint as well as the address of the destination, authorizing the access point to send the traffic.

You have to use something other than bridging to do this. Routing with NAT, for example. You can also use four address mode, if both ends of the WiFi link support it.

share|improve this answer
You can solve this problem by re-writing the mac addresses with ebtables – ccarton Oct 26 '13 at 11:24
I notice that one person here says you can in ubuntu..and i've done something like it in windows too.. though you say it's impossible so perhaps you can explain what the difference is between that and this. In Windows when u do this WiFi connected to the internet.No cable in Ethernet connector..or cable of another comp in Ethernet connector. Then Selecting WiFi adaptor and Ethernet adaptor, it bridges them, n then another computer can plug its cable in and use the Internet connection The laptop's still a WiFi client I think(and not an access point) – barlop Apr 24 '15 at 21:48
@barlop It's faking it with NAT by rewriting the MAC address so that the client impersonates the machines that are bridged to it. This is very fragile and as soon as you try to do anything unusual (non-IP traffic, multicast, many other things), it tends to break. If you want to bridge over wireless, use WDS. If you can't use WDS, route instead of bridging. It's not worth the pain. – David Schwartz Apr 25 '15 at 12:04
@DavidSchwartz If a person has a laptop with no working wireless and no network switch to plug it into for internet access, but another laptop has wireless internet access, and there's no spare wireless usb stick. Then it seems the only solution is the bridging fakery. If both laptops had a working wireless network adaptor they could both just connect to the main wireless access point, no need for extra access points and WDS.. I've used the bridging fakery when one laptop couldn't do wireless. – barlop Apr 26 '15 at 17:36
@barlop You can use real NAT, having the laptop with wireless act like a NAT router. This is what Internet Connection Sharing does. Just don't bridge, route. – David Schwartz Jun 12 '15 at 16:55

I had a similar problem with LXC, I worked around the bridging issue in wifi devices. First you need a spare ethernet device in the computer. The trick is to create a route from the ethernet device to the wifi.

In the server file, change /etc/network/interfaces, pick an unused network for your virtual hosts, i.e. Assign one IP to your spare ethernet interface, here it is eth0, bridging it like this:

auto br0
iface br0 inet static
    bridge_ports eth0
    bridge_fd 0
    bridge_maxwait 0

Once it is done you can go the MASQUERADE way as answered by Kostyantyn here before. Those should be in rc.local or in a script that you must run on boot-up or before starting the virtual domains:

# iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
# echo "1" > /proc/sys/net/ipv4/ip_forward

In the virtual server configure static IPs in /etc/network/interfaces. I am using network, I will start using from .2 , when you create more virtual hosts you probably will use 3, and so on. If you have many you can consider installing a dhcp server for those. The .1 is the gateway, as configured before.

auto eth0
iface eth0 inet static

Configure also a DNS server, mine was the network router, in /etc/resolv.conf:


Hope this helps

share|improve this answer

I think what you really need is not a bridge but either:

  • SNAT (if WLAN has a static IP) (see this page )


  • MASQUERADE (if WLAN has dynamic IP - that is, IP changes)

1) create with the following content:

echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

2) Run the file:

sudo ./

3) on the rest of the host specify your Ubuntu box as a gateway NOTE: if some of the boxes are also running Linux you can do it with this command:

sudo ip route add default via ubuntu-ip

where ubuntu-ip should be replaced by your ubuntu-box IP address i.e.

4) try pinging some IP, i.e. from other hosts:


5) check your DNS settings by pinging some domain, i.e.:


6) if step 4) works and 5) doesn't, than you have problems with your DNS settings. in such case run with root privileges:

# echo "nameserver" > /etc/resolv.conf

Run step 5) again.

More information on resolv.conf can be found here.

share|improve this answer

You need to bring down the interfaces before bridging them.

ifconfig eth0 down

ifconfig wlan0 down

share|improve this answer
Still get the same error with both interfaces down – Zac Powell May 20 '13 at 20:30
@Zac Powell are you using Network-Manager? I had some past experiences that it might interfere. In that case you can try stopping the service, and bring it back up again afterwards – Legionair May 20 '13 at 21:20
Yes I am, ok so i should try bringing them both down and stopping network-manager then doing the birdge and then bring everything back up? – Zac Powell May 20 '13 at 21:21
yes, with service network-manager stop, then do your thing, start it again with service network-manager start – Legionair May 20 '13 at 21:23
still not working :/ everything is shut down but still get the same error – Zac Powell May 20 '13 at 21:26
sudo iw dev wlan1 set 4addr on
share|improve this answer
Care to explain how this solve OP's problem? – Braiam Oct 13 '13 at 2:48
@Braiam My answer pretty much explains why this would work if it was supported by the AP. – David Schwartz Oct 13 '13 at 3:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .