2

I have two NIC Ethernet card (eth1 and eth2) on the same computer (linux) connected by a cross cable.

The two interfaces are on the same subnet :

eth1 : 192.168.200.1 255.255.255.0 

eth2 : 192.168.200.2 255.255.255.0 

Then i add a route for each interface :

route add -net 192.168.200.0 netmask 255.255.255.0 eth1 

route add -net 192.168.200.0 netmask 255.255.255.0 eth2

Finally,i'm trying to ping :

ping 192.168.200.1 -I eth2 or ping 192.168.200.2 -I eth1

Ping command reaches error : Destination Host Unreachable

Can anyone help me to fix this issue?

Thank you.

8
  • Have you tried adding -r to the ping command?
    – ezpz
    Jul 6, 2011 at 10:28
  • Are the interfaces UP?
    – Keith
    Jul 6, 2011 at 11:24
  • Yes both interface are up and i also try option -r on the ping command.But unfortunately ping reach same error.
    – Monu
    Jul 6, 2011 at 11:56
  • Why did you specify a route? Are you using a subnet that is configured elsewhere within your network?
    – cwawak
    Jul 6, 2011 at 14:33
  • Did you run the route commands as root? Are those ping commands separate, as in, ping 192.168.200.1 -I eth2, then you ran ping 192.168.200.2 -I eth1, not ping 192.168.200.1 -I eth2 or ping 192.168.200.2 -I eth1? Try running ping like this ping -I eth1 192.168.200.2.
    – evan.bovie
    Jul 6, 2011 at 14:33

2 Answers 2

1

To fix this issue, i use two virtual machine. And i can ping eth1 or eth2, with eth2 or eth1.

Thank you,all for yours comments and help.

1

Basically when u ping from your system, the source IP is set to INADDR_ANY. And when the kernel finds the destination IP to be on the same system, it will simply loopback it. Its using loopback (lo) interface.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .