Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have two networks on a server. One being my internal network, and the other being an external IP address. This is on Debian Lenny. Here is my /etc/network/interfaces file:

# 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 network interface
auto eth0
iface eth0 inet static
        address 172.16.130.250
        netmask 255.255.255.0
        broadcast 172.16.120.255
        gateway 172.16.130.1

auto eth1
iface eth1 inet static
        address 24.249.hidden ipaddy
        netmask 255.255.255.224
        broadcast 24.249.hidden broadcast.255
        gateway 24.249.hidden gateway

I can reboot my system and sometimes eth1 is accessible from SSH, and other times eth0 is accessible. Then sometimes eth1 will just stop being pingable alltogether. This is a fairly fresh install of Debian, and the only thing I have running is VMWare Server 2.0, bridged to both of my network connections.

share|improve this question
    
Could you add the output of "netstat -r" (or "ip route") under both (or all) situations? The default route may have something to do with this. Running "ifconfig" on the interfaces may also give you a hint. You've included what ought to happen, but you should look at what really happens. –  Bruce Ediger Mar 14 '11 at 17:03
    
gemini:~# netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 24.249.108.192 * 255.255.255.224 U 0 0 0 eth1 172.16.130.0 * 255.255.255.0 U 0 0 0 eth0 default wsip-24-249-108 0.0.0.0 UG 0 0 0 eth1 –  muncherelli Mar 14 '11 at 17:29
    
Where does the gateway on your internal network go? Unless the server needs outbound access beyond your internal gateway you won't need it if your on the same local network internally, but based on your output of netstat -r your routing tables look correct and shouldn't effect inbound access. When you have multiple network interfaces Linux will correctly add routes, the only issue is the default route which is correctly assigned to eth1. Also, when you say eth1 will just stop being pingable, is it that way when you boot up or does the interface drop after already being pingable? –  Deleted Account Mar 15 '11 at 17:11

1 Answer 1

up vote 3 down vote accepted

You've defined a gateway on both interfaces. So there is a default route through both interfaces. I'm not sure what exactly happens in this case, but I doubt this is what you intended. I suspect that only a smaller network should be accessible through eth0. You can do this by changing the corresponding stanza like this:

iface eth0 inet static
    address 172.16.130.250
    netmask 255.255.255.0
    broadcast 172.16.120.255
    up route add -net 172.16.120.0/20 gw 172.16.130.1 eth0
share|improve this answer
    
Worked perfectly. Thanks so much! –  muncherelli Mar 17 '11 at 19:16

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.