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

In windows I can select Local Area Connection and Wireless Network Connection, right click and select Bridge Connections

How can I achieve the same effect in Linux? (Debian to be exact)

Pretty much I want Computer B to connect to Computer A via ethernet cable. Well Computer A is connected wirelessly. Allowing Computer B to get on the internet.

== UPDATE ==

I've enabled IP forwarding and used the following iptables command:

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

I'm still unable to access the internet from Computer B though.

share|improve this question
do you using gnome/kde ? network manager have a master to make shared connection, if you like windows way... – zb' Dec 16 '12 at 1:49
up vote 2 down vote accepted

Here is a list of commands that you need to type in:

on computer A

  1. iptables -t nat -F (this will flush iptables nat section, everything that was there before)
  2. sysctl net.ipv4.ip_forward=1 (this will enable ip forwarding)
  3. iptables -t nat -A POSTROUTING -s IP_ADDRES_COMP_B -j MASQUERADE (this will nat eveything that comes from computer b

on computer B

  1. check that default gateway of this computer is COMPUTER A.
  2. check DNS servers on computer A , (cat /etc/resolv.conf) and set same on computer B.
  3. in case of trubles with DNS servers on computer A, use as primary and as secondary
share|improve this answer

From the debian wiki - Bridge Connections

First, you should install bridge-utils package. Rest of the article is pretty straightforward and explains much about how to set up working bridge connection to another device.

With the abovementioned iptables command you just routed Computer B to Computer A's wireless adapter. But Computer B cannot use that directly because it lacks the needed rules. It doesn't know where to go or what to do with it, so to speak.

share|improve this answer

Check out this ArchWiki article. You should just need the Enable NAT and Manually adding an ip sections, but if that doesn't work, then check out the rest.
Edited: Forgot a section.

share|improve this answer
I've followed the steps to Enable NAT but i'm still having trouble. See edit. – Josh Dec 15 '12 at 19:17
Check out the second section listed. Sorry. (If that doesn't work, just read the rest and check out some of the other links and relevant manpages.) – bb010g Dec 16 '12 at 1:18

You must log in to answer this question.

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