View Full Version : [ubuntu] how to set up a 2-NIC machine with an wireless AP?

September 1st, 2010, 09:39 AM
Hi All,

Although not new to linux or ubuntu, I am having real trouble getting a machine's networking to work properly. I'm using a desktop machine with ubuntu lucid.

The problem is that wireless clients can't pass data back and forth through the desktop machine to the net. However, when I log onto the machine at the console, I can browse the net fine. That is, eth0 is working. I can also ping machines which connect to the wireless AP hanging off eth1. But those machines which connect via the AP can't browse the net.

Here is picture of the config.

(Internet) --- (desktop with two NICs: eth0 + eth1) --- (DWL-2100AP Access Point)

The "Internet" connects to eth0, the AP connects to eth1. Here is the relevant stuff from the ifconfig output:

eth0 Link encap:Ethernet HWaddr 00:1d:60:3f:c3:1f
inet addr: Bcast: Mask:
inet6 addr: fe80::21d:60ff:fe3f:c31f/64 Scope:Link
eth1 Link encap:Ethernet HWaddr 00:14:78:0e:63:c5
inet addr: Bcast: Mask:
inet6 addr: fe80::214:78ff:fe0e:63c5/64 Scope:Link

The dlink dwl-2100AP is set to have IP, Gateway (ie. eth1), and subnet mask of

The AP also is set to be a dhcp server, and gives out IPs from, with subnet mask, Gateway (eth1), and DNS of

These assignments seem to be working because I can see the assigned IPs on wireless devices such as my ipod touch.

Can anybody let me know how I should be setting this up? It just seems that packets aren't getting through the desktop, and I can't figure out why.

Any help really greatly appreciated.

September 1st, 2010, 09:56 AM
You will need to add at least one routing rule to allow traffic to pass from one interface to the other. I have this working on my Ubuntu based router/wifi AP. I'm not sure how similar our setups would be though as I do it all manually. Not a default setup.

Post output of route command.

Mine looks like,

$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface * U 0 0 0 eth1 * U 0 0 0 eth0
default UG 100 0 0 eth0

But at the moment I disabled wifi so it doesn't show up here. I was using it on wlan0 and it was in the table too. Anyway, you want to get this table correct and may need one or more route add ... commands.

To annotate this, it says: for traffic going to 192.168.2.* send it to eth1 and for traffic going to 192.168.1.* send it to eth0, and for anything else send it to (gateway) where it will figure it out.