Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Hey everyone this is my first post so go easy on me.

I currently have a laptop with Ubuntu Studio 12.04 Beta 2 that is supplying a wireless internet connection to a windows 7 desktop computer that's connected directly to the laptop through Ethernet. I'm using the "shared to other computers" method in network manager but I believe it doesn't work with what I want to do. I would like to have the windows computer on the same subnet as every other computer in my house (192.168.1.x) so I can use LAN applications (MIDI over WiFi, Bonjour etc.) on the windows computer without having to run a massive cable to the router.

I've been googling endlessly and tried multiple configurations in the /etc/network/interfaces file without success. All of them would report "cannot add wlan0 to bridge"

This is the last configuration I tried:

auto lo
iface lo inet loopback

auto eth0
auto wlan0
auto br0

iface wlan0 inet dhcp
    wireless-essid 3GF2
    wireless-key passw*rd
    wireless-mode managed

iface eth0 inet manual
up ip link set eth0 up

iface br0 inet manual
    bridge_ports wlan0 eth0

Is there a specific way to make this work? What am I missing?

Thank you

share|improve this question

You can do the same thing by forwarding packets from ethernet card to wireless card. In order to do that, [wlan0 - wireless card; eth0 - ethernet card].

Do this on your ubuntu machine.

  1. ifconfig eth0 (or whatever you want)
  2. Enable ip_forward by echo 1 > /proc/sys/net/ipv4/ip_forward

  3. Enable forwarding in IPTABLES by iptables -A FORWARD --in-interface wlan0 -j ACCEPT

  4. Enable NAT mode to connect to internet by iptables --table nat -A POSTROUTING --out-interface eth0 -j MASQUERADE

On your windows machine set IP to and gateway to (ubuntu eth0 ip address)

No need to create bridges

share|improve this answer
Can't seem to get it to work. I've run the commands exactly as you told me except I put different IP addresses for both the eth0 card and the windows computer. They're both are within 192.168.1.x. Should I have the network configuration for eth0 on "Shared with other computers" or Manual or even disabled? – Miguel Azevedo Apr 13 '12 at 23:08
It seems that I can get the LAN to work because I can access the shared folders onthe the ubuntu machine but on the windows machine I can't see any of other computers on the network and I can't get internet. – Miguel Azevedo Apr 13 '12 at 23:39
type iptables -L and check the rules have applied. and type "cat /proc/sys/net/ipv4/ip_forward" and check the value is 1. Did you set the gateway to ubuntu machines ip on windows – Manula Waidyanatha Apr 14 '12 at 2:37
Indeed i have but no luck yet. ipforward spits out 1 and this is the output for iptables Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination what happens now is internet access on the ubuntu machine cuts out whenever I have my two machines connected. Any thoughts? Thanks a lot for your help btw – Miguel Azevedo Apr 15 '12 at 21:03
Sorry I've made a mistake you should change wlan0 with eth0 when typing iptables commands. – Manula Waidyanatha Apr 16 '12 at 1:18

I was able to circumvent bridging using one of the Ubuntu ICS guides.
The main page is here

I used the Ubuntu Internet Gateway Method (iptables) Method changing
External WAN: eth0 -> wlan0
Internal LAN: eth1 -> eth0

It worked immediately! The only downside is that it assumes both computers are Ubuntu flavors.

Jump directly to the Gateway Method

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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