Network Traffic Generation
Oleg Goldshmidt
pub at goldshmidt.org
Sat Mar 14 12:58:01 IST 2009
Shachar Shemesh <shachar at shemesh.biz> writes:
> Do the following experiment. Connect the 100 card to a network, and
> from another computer ping the 101 address while a sniffer is
> running. You will see an ARP reply going out from the 100 card,
> carrying the 100 MAC address, and the ping will succeed despite the
> 101 card being disconnected. Why? Because the computer says "I know
> how to reach 101 - it's my IP, so if the ARP reached the 100 card,
> it's probably a good MAC address to respond with".
Let me first make a disclaimer that I have not tried it myself in this
configuration, but here is what *might* point you towards a
solution. It may also turn out a dead end, mind you.
Try to use iproute2 to created multiple routing tables by policy. In
principle, iproute2 should enable you to create multiple routing
tables per process (you need "policy routing" enabled in the kernel,
too). Configure routing rules per destination host in such a way that
traffic intended to 101 goes out of device eth0, and traffic intended
to 100 goes out of device eth1.
Google for more descriptions and explanations for "multiple default
gateways linux" or some such. Some links that (say similar things and)
may be of help are
http://www.clintoneast.com/articles/multihomed.php
http://lartc.org/howto/lartc.rpdb.multiple-links.html
http://linux-ip.net/html/adv-multi-internet.html
http://kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/
Once again, I am not saying it is a solution for you problem, just
something that might help you work it out, if it is at all possible.
> The most immediate solution is to run a virtual machine, and give it
> exclusive access to one of the NICs. This way you can configure, for
> example, the 100 address in the real machine and the 101 address in
> the virtual one.
But this does not necessarily mean packets will go out of the machine
- hypervisors include local (in-box) switching nowadays.
--
Oleg Goldshmidt | pub at goldshmidt.org
More information about the Linux-il
mailing list