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 am trying to have eth0 connected to eth1 on the same machine with a loopback cable. I have eth0 as 2.2.2.1 and eth1 as 2.2.2.2 with netmask 255.255.255.0 and the right Bcast 2.2.2.255 . I tried to ping -I eth0 2.2.2.2 and ping -I eth1 2.2.2.1. My issue is that even when the loopback cable is not plugged the ping still succeed( as if it is an internal ping). How can I force an external ping where I make sure the packets are going through the connected cable? ( I know I can have a router and both ethernets connected to it, but I am avoiding to use anything besides a simple cat 5 cable). Thanks.

share|improve this question

2 Answers 2

I don't believe you can do that. Both interfaces are on the same network. So, the the kernel knows that. Also, the ARP information is on the host. I don't believe that you can force such thing especially at layer 2.

Layer 3 communication is something different, but, even that way, I don't see how you will force the TCP/IP stack of the kernel to ignore the fact that it knows everything that is required for the communication.

The only viable option if to force the interface to be up or down, depending on the cable status (plugged/unplugged).

share|improve this answer

Interesting question, I think this answer will be enough http://serverfault.com/questions/127636/force-local-ip-traffic-to-an-external-interface

Your problem is just a specific case of that.

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.