[kwlug-disc] using "nc" to simulate a bunch of machines swapping packets?

Robert P. J. Day rpjday at crashcourse.ca
Fri Dec 26 12:43:28 EST 2008


On Fri, 26 Dec 2008, Chris Frey wrote:

> On Fri, Dec 26, 2008 at 05:51:39AM -0500, Robert P. J. Day wrote:
> >
> >   i'd like to simulate a small number of systems on an isolated
> > network shipping packets around.  can i use "nc" to emulate that sort
> > of thing on a single host?  has anyone done anything along those
> > lines?  thanks.
>
> Not sure I understand the question, but something like this?
>
> Machine 1:
> 	nc -l -p 2222 > /dev/null
>
> Machine 2:
>
> 	nc machine1 2222 < /dev/zero
>
> This works on localhost as well.

  actually, there was a bit more to it as i wanted these simulated
systems to have unique IP addresses, but i think i solved that by
simply ifconfig'ing a bunch of eth0:[1-n] IP addresses, and
associating an invocation of nc with each of those.  now it really
appears that i have a number of independent IP-addressed systems
passing around packets.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================




More information about the kwlug-disc mailing list