Two network adapters on Ubuntu Server 9.10 - Can't have both working at once?
Posted
by Rob
on Server Fault
See other posts from Server Fault
or by Rob
Published on 2010-04-06T02:41:30Z
Indexed on
2010/04/06
2:43 UTC
Read the original article
Hit count: 617
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 it's external IP address fails, but I can ping it's local IP address.
If I bring eth1 down using sudo ifdown eth1
, I can successfully ping the machine via it's external IP address again (but obviously not it's 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.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
network xxx.xxx.xxx.xxx
broadcast xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
# 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 [external ip]
Pinging [external ip] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for [external ip]:
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 [external ip]
Pinging [external ip] with 32 bytes of data:
Reply from [external ip]: bytes=32 time<1ms TTL=63
Reply from [external ip]: bytes=32 time<1ms TTL=63
Reply from [external ip]: bytes=32 time<1ms TTL=63
Reply from [external ip]: bytes=32 time<1ms TTL=63
Ping statistics for [external ip]:
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?
© Server Fault or respective owner