I'm in the middle of doing some testing on a mobile device, and want to test it from the network. The mobile device will only connect to networks via WiFi, and doesn't support ad-hoc mode, so I've set up an old WiFi router as an AP, which is connected via ethernet to a port on my laptop. The router operates under

My laptop is also connected to our normal network via another ethernet port. This network operates under, and provides internet connectivity.

My laptop is running a VM which has two NICs, each bridged onto the two respective physical NICs. The network is reachable via eth0, and the network is reachable via eth1.

The problem I'm having is that all connectivity drops as soon as I run ifup eth1. I've tried changing routing tables and adapter metrics, but have had no luck.

Here's the output from ifconfig -a:

eth0      Link encap:Ethernet  HWaddr 08:00:27:04:7a:b7  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::a00:27ff:fe04:7ab7/64 Scope:Link
          RX packets:18135 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11076 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12226743 (12.2 MB)  TX bytes:1047606 (1.0 MB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:96:cf:1c  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::a00:27ff:fe96:cf1c/64 Scope:Link
          RX packets:1803 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1439 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:166923 (166.9 KB)  TX bytes:118391 (118.3 KB)

Here's my routing table:

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

And the output from ip route:

default via dev eth1  metric 100 
default via dev eth0  metric 100 dev eth0  proto kernel  scope link  src dev eth1  proto kernel  scope link  src 

Ideas? I'm not a Linux guy, so I'm stumped by this.


# cat /etc/network/interfaces 

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet dhcp

auto eth2
iface eth2 inet dhcp

auto ath0
iface ath0 inet dhcp

auto wlan0
iface wlan0 inet dhcp

Output from ip route after dropping the eth1 default route:

default via dev eth0  metric 100 dev eth0  proto kernel  scope link  src dev eth1  proto kernel  scope link  src 
  • Are you using VirtualBox? And are you absolutely certain that you used bridged networking in setting it up? This looks like you did not. You can't bridge to a wireless adapter this way anyway. – Michael Hampton Sep 24 '13 at 15:09
  • Yes, it's VirtualBox. Absolutely sure both are bridged. It's not a wireless adapter - both adapters are wired (just one happens to be connected to a WiFi AP device via Ethernet). – Polynomial Sep 24 '13 at 15:19
  • What are the contents of your eth1 configuration file? (/etc/sysconfig/network-scripts/ifcfg-eth1 if you're in Red Hat Enterprise Linux or derivatives) – John Sep 24 '13 at 15:19
  • I don't have that file - it's BackTrack 5 so it's based on Ubuntu, rather than RHEL, I believe. – Polynomial Sep 24 '13 at 15:20
  • 1
    What do you mean by "all connectivity drops"? Also, your default routes both have the same metric. You might do better to not have a GW set on eth1 and to lose the default route out eth1. – TheCleaner Sep 24 '13 at 15:21

I'm not as familiar with Debian, but what TheCleaner says is where I think your issue is. When you configured your eth1 interface, you added a "new" default route, which is interfering with your preexisting default route. If you remove that "default" route from eth1, you should be okay - I just don't know how to tell you to remove that config bit in a Debian-like OS.

  • I used ip route del to kill off the secondary route but am still facing the same issue - no connectivity to the internet via the network. – Polynomial Sep 24 '13 at 15:25
  • Please update the output of ip route – mveroone Sep 24 '13 at 15:26
  • @Kwaio The only difference when I kill the route is that the top line disappears. When I do ifdown/ifup the line comes back. – Polynomial Sep 24 '13 at 15:29
  • The route changes should have fixed your internet connectivity. Once you get that working :p you can disable sending of the default gateway field in the dhcp server on the network to get the conflicting route to not show up. – Daniel Widrick Sep 24 '13 at 16:25
  • @IVint67 The internet connectivity is absolutely fine when eth1 is down. The instant eth1 comes up everything dies. I can't change the DHCP server config though, it's a crappy old router with vendor firmware burned into it :( -- surely my removal of the route should've fixed that if it was the issue anyway? – Polynomial Sep 24 '13 at 16:28

Your problem is the DHCP. Even if you can't disable the server, you can choose to not ask him for an address and choose it yourself :

When eth1comes up, it automatically adds a second default gateway, which shouldn't be the default one, DHCP's fault.

You have to edit `/etc/network/interfaces, and change :

auto eth1
iface eth1 inet dhcp

by :

auto eth1
iface eth0 inet static

Note that there is no gateway specified, and '200' is choosed randomly, with the hope of being out of the DHCP range. Then you can do ifdown eth1/ ifup eth1.

If you still have problems at this point, please update the outputs of ifconfig, ip route -a and cat /etc/network/interfaces

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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