Testing Dual Ethernet via Loopback

From: Nick Popoff
Date: Mon Apr 19 2004 - 20:13:22 EST


I am trying to write some software to test a dual port ethernet card. I
was hoping to be able to use an ethernet cable to just connect the
ethernet board to itself and then write a program that talks to itself to
make sure that both ports are working. However, I've noticed that Linux
is smart enough to realize it is talking to its own IP address, and it
just delivers the data internally rather than use the network hardware at

So what I'm wondering is if there is a way to force Linux to actually
utilize its network hardware in sending these packets to itself? In other
words, a ping or file transfer from an IP assigned to eth0 to another IP
assigned to eth1 should fail if I unplug the network cable connecting the
two. Any advice on this would be much appreciated. I'm not afraid of
reading kernel source but have no idea where to start on this one.

I'm using 2.4.22 but would use any 2.4 or 2.6 kernel that supported this
behavior. The National Semiconductor DP83815 (natsemi.o) is the
ethernet chipset.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/