July 14, 2021 . 3 MIN READ
| 5 down vote favorite
1 |
I’m trying to set up two network adapters in Ubuntu (server edition) 9.10. One for the public internet, the other a private LAN.
During the install, I was asked to pick a primary network adapter (eth0 or eth1). I chose eth0, gave the installer the details listed below in the contents of /etc/network/interfaces, and carried on. I’ve been using this adapter with these setting for the last few days, and every thing’s been fine. Today, I decide it’s time to set up the local adapter. I edit the /etc/network/interfaces to add the details for eth1 (see below), and restart networking with sudo /etc/init.d/networking restart. After this, attempting to ping the machine using its external IP address fails, but I can ping its local IP address. If I bring eth1 down using sudo ifdown eth1, I can successfully ping the machine via its external IP address again (but obviously not its internal IP address). Bringing eth1 back up returns us to the original problem state: external IP not working, internal IP working. Here’s my /etc/network/interfaces (I’ve removed the external IP information, but these settings are unchanged from when it worked) rob@rhea:~$ cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5).
# The loopback network interface auto lo iface lo inet loopback
# The primary (public) network interface auto eth0 iface eth0 inet static address xxx.167.218.118 netmask 255.255.255.240 network xxx.167.218.112 broadcast xxx.167.218.127 gateway xxx.167.218.126
# The secondary (private) network interface auto eth1 iface eth1 inet static address 192.168.99.4 netmask 255.255.255.0 network 192.168.99.0 broadcast 192.168.99.255 gateway 192.168.99.254 I then do this: rob@rhea:~$ sudo /etc/init.d/networking restart * Reconfiguring network interfaces… [ OK ] rob@rhea:~$ sudo ifup eth0 ifup: interface eth0 already configured rob@rhea:~$ sudo ifup eth1 ifup: interface eth1 already configured Then, from another machine: C:\Documents and Settings\Rob>ping xxx.167.218.118
Pinging xxx.167.218.118 with 32 bytes of data:
Request timed out. Request timed out. Request timed out. Request timed out.
Ping statistics for xxx.167.218.118: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), Back on the Ubuntu server in question: rob@rhea:~$ sudo ifdown eth1 … and again on the other machine: C:\Documents and Settings\Rob>ping xxx.167.218.118
Pinging xxx.167.218.118 with 32 bytes of data:
Reply from xxx.167.218.118: bytes=32 time<1ms TTL=63 Reply from xxx.167.218.118: bytes=32 time<1ms TTL=63 Reply from xxx.167.218.118: bytes=32 time<1ms TTL=63 Reply from xxx.167.218.118: bytes=32 time<1ms TTL=63
Ping statistics for xxx.167.218.118: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms So… what am I doing wrong? SOLVED The fix first to remove the gateway information from the eth1 stanza (as MikeyB suggested) and then remove the route for eth1’s network address from the routing table as such: sudo route del -net 192.168.99.0 netmask 255.255.255.0 dev eth1 |