My laptop connects to our apartment network via Wifi. I'd like to share this connection using the laptop's Ethernet port, i.e. be able to plug another system into Ethernet and have it also use the Wifi. How do I do this?


Your wifi interface works logically like a normal network card.

You can configure your machine as bridge. I followed linuxfoundation's tutorial to bridge in networking.

If you are now connected to 2 networks and only one of these two networks allows connection to Internet, maybe you want to provide web connection to all the machines in your private area by using your machine. It's called web-proxy and squid is the server package you need to do the work. Squid's wiki provides configuration examples for different situations.

  • 1
    Please before you do anything review your company security policy. Some network manipulation may be considered as a hacking tentative in some cases. Just for advice ! – Slyx Jan 1 '14 at 5:52
  • Thanks for the response. I tried setting up a bridge, but when I tried to add wlan0 to the bridge I get the error "can't add wlan0 to bridge br0: Operation not supported". – fred basset Jan 1 '14 at 21:41

Apparently this is difficult.

From http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge it seems the problem lies in your wireless card's driver as it states "Many wireless cards don't allow spoofing of the source address". This is probably (?) a security issue.

This website also mentions "If you urgently need to have a wireless LAN card which is able to bridge, you should use one of those having the prism chipset onboard (manufactured by Harris Intersil)." I don't know how current this information is, so there might be other cards with this functionality.

I think you could try this: https://wiki.debian.org/BridgeNetworkConnections#Bridging_with_a_wireless_NIC

I didn't get all the steps, so I am not sure it overcomes the driver spoofing limitation. An easier alternative is to use packet forwarding (ipchains and masquerading) to forward tcp/udp packets (which is what I think is what you want to do anyway, you are not trying to set up a cluster with a custom network architecture, right?). This is "easier". An example is http://www.tldp.org/LDP/nag2/x-087-2-masq.configuration.html. Perhaps you can google and find something more current or easier to understand.

One of the problems that I found with using packet forwarding is that it tends to break if you add a phone with an usb cable and set it to tether or change any parameter on the wifi. Also so to get it to work you will need to think about your network structure a little bit. This also runs on a higher level of osi layer, so it is also slightly slower. Anyway, good luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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