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 have a box with Linux Ubuntu 8.04 and 4 Ethernet ports. I enabled 2 ports, eth0 and eth1, and am trying to configure them with static IPs (eth0 = 192.168.0.205 and eth1 = 192.168.0.206).

If I plug 2 cables, one for each, I can to ping my equipment by each IP as expected. But, if I remove the cable from eth1, I still can ping both IPs still. After this I can disable eth1 and the 2 IPs still will be available for me on eth0.

If I to plug the cable in eth1 there is no difference, just eth0 port workings.

I did a test, and if I configure the 2 IPs in distinct subnets this problem doesn't occur.

share|improve this question
1  
I don't understand what the problem is. What do you want to achieve? –  Kvisle Oct 20 '11 at 17:13
    
How did you configure the ports? Command line program or some sort of configuration utility? –  Chris S Oct 20 '11 at 17:19
    
I would like than eth0 had 192.168.0.205 ip and eth1 192.168.0.206, but both are controlled just by eth0. –  Adriano Leal Oct 20 '11 at 17:24
    
I configured the ports by /etc/network/interfaces file and after i restarted the networking process with '/etc/init.d/networking restart' command. –  Adriano Leal Oct 20 '11 at 17:26
    
To have multiple ip-addresses on one interface, add the 2nd address with ifconfig eth0:0 192.168.0.206 up. Next address goes with eth0:1 up to eth0:255. You can use the 2nd adapter to connect to a physical different LAN. –  ott-- Oct 20 '11 at 18:01

1 Answer 1

This happens because by default Linux consider an IP address as a property of the whole host, not just a particular interface; therefore an ARP request from outside (which will be received by both interfaces) will cause a reply from all interfaces, not just the one with the requested IP.

Look at this answer to a question similar to yours (there is also another way involving arptables described there).

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.