Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 192.168.0.0/24.

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

My laptop is running a VM which has two NICs, each bridged onto the two respective physical NICs. The 10.0.2.0 network is reachable via eth0, and the 192.168.0.0 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:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe04:7ab7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          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:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe96:cf1c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          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
0.0.0.0         192.168.0.1     0.0.0.0         UG    100    0        0 eth1
0.0.0.0         10.0.2.2        0.0.0.0         UG    100    0        0 eth0
10.0.2.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1

And the output from ip route:

default via 192.168.0.1 dev eth1  metric 100 
default via 10.0.2.2 dev eth0  metric 100 
10.0.2.0/24 dev eth0  proto kernel  scope link  src 10.0.2.15 
192.168.0.0/24 dev eth1  proto kernel  scope link  src 192.168.0.5 

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


Edit:

# 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 10.0.2.2 dev eth0  metric 100 
10.0.2.0/24 dev eth0  proto kernel  scope link  src 10.0.2.15 
192.168.0.0/24 dev eth1  proto kernel  scope link  src 192.168.0.5 
share|improve this question
    
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

2 Answers 2

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.

share|improve this answer
    
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 10.0.2.0/24 network. –  Polynomial Sep 24 '13 at 15:25
    
Please update the output of ip route –  Kwaio 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 192.168.0.0/24 network to get the conflicting route to not show up. –  lVlint67 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
address 192.168.0.200
netmask 255.255.255.0

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

share|improve this answer

Your Answer

 
discard

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.