Pretending to be a network node



Hello,

I have a program P that connects on eth0, it sends and receives packets
from the network on that interface. I want to make another program that
pretends to be on the eth0 network, but it's actually on the same
machine as P. Is there a way to do that?

I was thinking maybe there's a way of creating a new interface, say
eth1, and somehow connect it to eth0 in a way that eth0 thinks it's
getting messages from the network, when in fact it's getting messages
from another interface in the same computer. That way I'd be able to
listen to the same udp port on both interfaces and stabilish a two-way
connection between two programs, one connected to eth0 and another
connected to eth1.

I'm using Debian Linux, so system-specific solutions are ok. I'm
interested in knowing solutions for this problem that will work in other
unix systems as well (or even non-unix systems).
.



Relevant Pages