Routing traffic externally instead of internal loop

I have one Ubuntu box with 2 network cards.

I am running netperf on the computer to measure performance of networking equipment, ethernet coming out of eth0 into the switch then back out into the second card eth1. Currently when I run the test it seems to be sending the traffic internally (throughput is way to fast to be external) as opposed to out the card and back in the other card. How can I configure the traffic to be sent out externally instead of internally?

I have tested many solutions I found online with no avail.

Thanks.

Answer

https://stackoverflow.com/questions/2734144/linux-disable-using-loopback-and-send-data-via-wire-between-2-eth-cards-of-one has interesting information about how the kernel uses the local routing table to know 10.0.0.1 can be routed internally.

  1. I’ve named eth1 10.0.0.1, which has no wire attached;
  2. ip route show table local reveals that local 10.0.0.1 dev eth1 ... src 10.0.0.1 exists. Pinging 10.0.0.1 works from this very machine.
  3. ip route delete 10.0.0.1 dev eth1 table local makes my ping go silent.
  4. ip route add 10.0.0.1 dev eth0 table local makes me receive “destination unreachable” through the local loop, but no ICMP requests on the local loop.

Attribution
Source : Link , Question Author : Corydon , Answer Author : Community

Leave a Comment