Send traffic to itself using real NIC

Jason Hellenthal jhellenthal at dataix.net
Tue Aug 7 15:37:44 UTC 2012


On Tue, Aug 07, 2012 at 08:53:52PM +0700, Eugene Grosbein wrote:
> Hi!
> 
> I'd like to run some stability tests for some L2-transparent
> gigabit ethernet network hardware I've got.
> 
> I have one spare FreeBSD 9.1-PRERELEASE with two-ports igb(4) card
> and connected both ports using my L2 hardward making a loop.
> 
> Is it possible to configure FreeBSD in such way so it would send
> IP traffic for itself not via loopback interface but via igb0/igb1?
> 
> I've tried to utilize multiple FIBs:
> 
> sysctl net.add_addr_allfibs=0
> ifconfig igb0 inet 10.0.0.1/24 mtu 9126
> ifconfig igb1 inet 10.0.1.1/24 mtu 9126
> setfib 1 route -q flush
> setfib 1 route add 10.0.1.1/32 -iface igb1
> setfib 2 route -q flush
> setfib 2 route add 10.0.0.1/32 -iface igb0
> 
> But "setfib 1 ping -S 10.0.0.1 10.0.1.1" still runs via lo0 (and has no answer).
> 
> The only way I've got working is unidirectional stream of packets
> generated with ng_source(4) (patched due to kern/120304) that shows me 10% packet loss
> (using netstat -I to see how many packets got through).
> 
> I would really like using normal TCP/UDP/ICMP streams in addition of ng_source tests.
> 

You could just throw a loopback plug in your adapter. All traffic going
out is going to come right back in as fast as its sent out.

Another alternative is a crossover cable from igb0 -> igb1.

-- 

 - (2^(N-1)) JJH48-ARIN

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20120807/907fa3c6/attachment.pgp


More information about the freebsd-net mailing list