I have one Linux machine having two gigabit network interface. I want to run the traffic test such as iperf on two interfaces: eth0 will be server and eth1 will be client. I connected back-to-back network cables (between eth0 and eth1) and configured the ip address

ifconfig eth0 netmask up

ifconfig eth1 netmask up

Now i am trying to ping from eth0 to eth1 using following command:

ping -I eth0

but ping is not working, so I tried tcpdump

tcpdump -i eth0

which says ARP request is reaching to eth1—but eth1 doesn't reply

I tried another way also using

ping -I eth1 

but it is also not working

arp -a 

command says incomplete, so I am wondering why this is not working, i tried this same configuration in Ubuntu and CentOS. but no luck. The /etc/hosts file is not configured—is it required? I already tried using straight as well as cross cable.

  • 1
    Are you using a crossover cable? – jordanm Jul 16 '15 at 1:02
  • Is your hosts file configured? – eyoung100 Jul 16 '15 at 1:22
  • is "netamsk" in your 2nd ifconfig line a copy/paste typo or a real one? – Jeff Schaller Jul 16 '15 at 1:45
  • 1
    Having two interfaces in the same /24 network on one machine won't work. What are you trying to achieve? – wurtel Jul 16 '15 at 11:20
  • I tried using crossover as well as straight cable, but it is not working. hosts file is not configured. Is it required? Also netamsk is typo in the eth1 configuration while sending the post. I have not enabled the ip_forward it is 0 in /proc/sys/net/ipv4/ip_forward. Also what i am trying to achieve is to run traffic test between two ethernet port. – saurin Jul 16 '15 at 16:02

This can work, but is not a normal configuration. If you want services within a server to talk via multiple IP addresses consider using multiple loop back interfaces, EG lo0, lo1 That eliminates bandwidth and physical layer issues.

That said, if the ICMP echo request is being sent and received, but not replied to, that suggests a firewall issue. Double check that no firewall rules are blocking it, possibly via flushing iptables temporarily.

  • i tried even shutting down the iptable service using "service iptables stop" command but even that did not help. – saurin Jul 16 '15 at 20:12
  • Any reason your services can't run on an ip address that uses the local loopback?,, etc – thebiggestlebowski Sep 23 '20 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.