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

Does connecting to multiple networks with different subnet in Ubuntu actually require some extra steps to work correctly?

I have 2 network interfaces on my computer, one is wired nic and the other is wireless USB adapter. Both of them are connected to different routers on different subnet. Before you ask

$ ip -4 a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    inet scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    inet brd scope global eth0
4: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    inet brd scope global wlan1

$ ip -4 r
default via dev eth0  proto static dev eth0  proto kernel  scope link  src  metric 1 dev eth0  scope link  metric 1000 dev wlan1  proto kernel  scope link  src  metric 2 

$ netstat -rn output
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface         UG        0 0          0 eth0   U         0 0          0 eth0     U         0 0          0 eth0   U         0 0          0 wlan1

I can ping both of the gateway IP fine but binding a connection to the USB adapter network never work. So any idea how to fix this?

share|improve this question
up vote 1 down vote accepted


Turns out that I need to add a new routing table for the additional nic and then add routing rules for it in the table. Read more for instructions in this link

share|improve this answer

I'm not sure about curl, but wget's man page says:

       When making client TCP/IP connections, bind to ADDRESS on the local
       machine.  ADDRESS may be specified as a hostname or IP address.
       This option can be useful if your machine is bound to multiple IPs.

Specify the IP address of the nic you want to use.

share|improve this answer
I know how to bind interface :) – Flint Jun 17 '12 at 2:48

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.