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

I have hostapd and dnsmasq installed for distributing my wireless network with a WiFi dongle, and everything is working well. I am also able to connect an ethernet cable and get DHCP, plus internet access, from a router.

Is there a way to bridge the internet connection from eth0 to my dynamically configured wlan0? So it becomes possible to connect with wifi and surf the net, like a router.

I am running Ubuntu, on a beaglebone black.

share|improve this question

In Debian and relatives, before starting hostapd, you need to do the following:

  sudo service network-manager stop
  sudo ifconfig eth0 down 
  sudo ifconfig eth0 promisc up
  sudo brctl addbr br0
  sudo brctl addif br0 eth0
  sudo dhclient br0 

Then, add the following line to /etc/hostapd/hostapd.conf:


hostapd will add itself to the bridge, you just need to tell it to do so and the name of the bridge.

Now you can start hostapd, without DHCP nor dnsmasq, of course. This is because by bridging wifi and ethernet, your wifi clients will be able to ask your router directly for an IP address, so there is no need of the whole shebang of DHCP/dnsmasq on the wireless interface.

If you need info for a systemd distro, just say so.

share|improve this answer
Where to put this to get everything working on boot? – Dirk Gorissen Mar 22 at 15:13

If the IP addresses for the wireless clients are in the same range as the dynamic address of the PC with the ethernet card, perhaps simply enabling IP forwarding could be all you need:

echo 1 > /proc/sys/net/ipv4/ip_forward

If the IP range of the wireless clients should be shielded somehow, you'll need to configure NAT. You can find some more detailed information here

share|improve this answer
Thank you very much for this post! Solved my problem! – user3142264 Dec 29 '13 at 20:08

You must log in to answer this question.

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