How to ping eth0 from eth1 on the linux machine

ethernetipping

I have a linux machine with 2 ethernet ports(eth0 and eth1). eth0 is connected to a router which assigns it an IP address 192.168.1.2. eth1 is connected to a switch which doesn't have an IP. How do I ping eth0 from eth1?

Best Answer

You can use the -I parameter, eg.

# ping -I eth1 192.168.1.2
Related Topic