On Arch Linux, I would like to have eth0 (connected to bridged router) share the connection received from wlan0, I've read tutorials but I'm not command savvy as other users are and don't completely understand.

  • 7
    please do not put '[solved]' in the question or title, accepting an answer is the correct way to show that a problem was solved. It changes the way the question is displayed on the main listing as well as putting the green check mark on the answer you have marked as correct. – Zypher Sep 25 '10 at 0:14
  • 1
    I'd appreciate it if nobody messed with this page. If you have any problems, contact me. Thank you. – dbdii407 Sep 25 '10 at 0:26
  • 12
    serverfault.com/faq Specifically the heading "Other people can edit my stuff" – Zypher Sep 25 '10 at 0:45
  • @Zypher The URL you link to no longer exists. Has the relevant paragraph moved elsewhere? – kasperd Apr 15 '15 at 13:04
  • 4
    @kasperd serverfault.com/help/editing – Zypher Apr 15 '15 at 13:06


It is not possible to bridge between wireless (client a.k.a. station mode) and wired interfaces according to this thread on linux-ath5k-devel.

Setup NAT

One should set up NAT instead:

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

Assigning an IP

Then you have to assign IP addresses to yourself:

ifconfig eth0 netmask up

Install dhcp daemon

Install a dhcp server and add the following text to its config file (in /etc/dhcpd.conf or something similar)

subnet netmask {
    option routers;
    option domain-name-servers the-ip-address-you-have-in-etc-resolv.conf;

Start dhcpd

Then start it /etc/init.d/dhcpd start

And that's it!

Only read below if you are interested in the non-working bridging setup

brctl addbr mybridge
brctl addif mybridge eth0
brctl addif mybridge wlan0

First you create a bridge interface I choose an arbitrary name mybridge then add intefaces to it.

You should request a new ip address (This is needed only if you want to get a valid IP for the bridging device itself):

dhclient -d mybridge
  • 3
    You don't actually need an IP address for the bridge interface for the bridging to work. – Massimo Jun 18 '10 at 10:25
  • 7
    can't add wlan0 to bridge mybridge: Operation not supported – dbdii407 Jun 18 '10 at 13:21
  • 1
    @Massimo: yes that is true. The valid IP is needed to acccess the net from the "bridging device". – cstamas Jun 18 '10 at 17:27
  • 9
    NAT is something completely different from bridging. Bridging is layer two, NAT is layer three, and IPv4-specific. I don't understand why this is an accepted answer. – WhyNotHugo Oct 3 '14 at 8:38
  • 2
    @Hugo IP NAT is layer 3, but MAC NAT is layer 2. For WiFi bridging, you can use 4addr, WDS, MAC NAT or you can do something at layer 3 (such as IP NAT) instead. – David Schwartz Apr 21 '17 at 8:44

To bridge wifi interface you may use iw tool to enable 4addr likewise:

# iw dev <wifiInterface> set 4addr on


# brctl addif <bridgename> <wifiInterface>
can't add <wifiInterface> to bridge <bridgename>: Operation not supported

# iw dev <wifiInterface> set 4addr on
# brctl addif <bridgename> <wifiInterface>

Now it should work. You can show bridges using:

# brctl show
  • 2
    What is this setting for and why do you specifically suggest to use it in this scenario? – hakre Jun 19 '16 at 17:07
  • This is a solution for "Operation not permited" error when trying to add wlan0 interface to the bridge interface. After that you have to specify the bridge interface in /etc/network/interfaces in order to be bringed up after startup. – Str82DHeaD Oct 19 '16 at 12:45
  • 1
    @hakre The 4addr mode make WiFi behave enough like wired Ethernet that bridging will work. Without it, bridging will not work without NAT. – David Schwartz Apr 21 '17 at 8:42
  • 1
    4addr does require that both sides of a wireless link support it (presuming you are trying to implement a wifi extender) – nhed Apr 17 '18 at 16:15

Depends on how mean the AP is to you:

1) It might only want to see packets coming from you, with your known link layer address (and hence not of bridged packets) 2) It might actually be even smarter, and know which IP address should belong to which link layer address (cause it knows DHCP and inspects it)

If 1+2 are both true, you need indeed something like IP NAT, DHCP, ..

But if only 1) is the case, you can fake the link-layer address, and reverse map it onto the right one in the other direction as described here:


  • This is really messy. And it requires extra setup every time you add a new computer. – Michael Hampton Apr 15 '15 at 14:49

To bridge wifi interface you may use iw tool to enable 4addr likewise:

# iw dev <wifiInterface> set 4addr on


# brctl addif <bridgename> <wifiInterface>
# can't add <wifiInterface> to bridge <bridgename>: Operation not supported

# iw dev <wifiInterface> set 4addr on
# brctl addif <bridgename> <wifiInterface>

Now it should work. You can check with:

# brctl show

It might not work if iw itself reports an error, like "command failed: Operation not supported (-95)" (seen on Raspbian). Not all drivers implement the feature, apparently.

  • While this does allow you to a wifi interface to a bridge it will also break the connectivity to that wifi interface. I think this could be resolved with iptables or route, but I'm not savvy enough with those tools to know how to fix the issue. – RoraΖ Jun 22 '17 at 12:52

4addr as described in other answers is certainly the best way when supported by the adapter/driver, but not all of them does. NAT might work for some things, but getting proper communication both ways on the lan will become problematic (ex. connecting a printer or accessing other IoT devices on the other side of the NAT). Anything relying on broadcast/multicast (ex. auto-discovery, bonjour) will fail through the NAT.

The alternative is using an ARP Proxy (parprouted) as described in https://wiki.debian.org/BridgeNetworkConnectionsProxyArp. I've set this up on a Raspberry Pi for a printer and it works like a charm (I have added a 10 second sleep in the post-up commands to let it get an IP address first, it might have to do with the slowness of my old RPi...)

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.