Subject: Re: Sending network traffic to "self" externally - is it possible?
To: Bryan Phillippe <bryanp35@comcast.net>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-help
Date: 04/15/2007 14:29:55
[moved to netbsd-help]

  I'm trying to test an ethernet switch.  I have a single workstation
  that already has multiple NICs in it, and I'd like to be able to use
  it for this purpose.  In addition to saving space & power, it will
  also be easier if I only have to manage a single system.  Furthermore,
  I could run simultaneous captures (e.g. tcpdump) on both interfaces,
  which also simplifies timestamp comparison.

You can likely do this by changing routes.  When you ifconfig an
address, you'll get a cloning route for the subnet, which will lead to
arp and "arp entries" which are really host routes with LLINFO and
WASCLONED flags.

You can delete the cloning route, or you can just add a host route.
Beware that this will disrupt ARP functioning and if the switch is
paying attention that may be trouble.  But if it's truly an Ethernet
switch, it won't look at IP or ARP.

You may also find that output packets get checked someplace for "is this
one of my addrs", but my memory on this is very fuzzy - that may only be
on input.

You could also write a test program with bpf that doesn't use IP.

-- 
    Greg Troxel <gdt@ir.bbn.com>