From owner-freebsd-net@FreeBSD.ORG Tue Aug 7 14:34:36 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85630106566C; Tue, 7 Aug 2012 14:34:36 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.zvne.fer.hr (mail.zvne.fer.hr [161.53.66.5]) by mx1.freebsd.org (Postfix) with ESMTP id C913E8FC15; Tue, 7 Aug 2012 14:34:35 +0000 (UTC) Received: from munja.zvne.fer.hr (161.53.66.248) by mail.zvne.fer.hr (161.53.66.5) with Microsoft SMTP Server id 14.2.298.4; Tue, 7 Aug 2012 16:33:25 +0200 Received: from sluga.fer.hr ([161.53.66.244]) by munja.zvne.fer.hr with Microsoft SMTPSVC(6.0.3790.4675); Tue, 7 Aug 2012 16:33:24 +0200 Received: from localhost ([161.53.19.8]) by sluga.fer.hr with Microsoft SMTPSVC(6.0.3790.4675); Tue, 7 Aug 2012 16:33:23 +0200 From: Marko Zec To: Date: Tue, 7 Aug 2012 16:33:11 +0200 User-Agent: KMail/1.9.10 References: <50211DF0.2090607@rdtc.ru> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201208071633.11524.zec@fer.hr> X-OriginalArrivalTime: 07 Aug 2012 14:33:24.0222 (UTC) FILETIME=[99CC71E0:01CD74A9] Cc: Jacques Fourie , Eugene Grosbein , "net@freebsd.org" Subject: Re: Send traffic to itself using real NIC X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2012 14:34:36 -0000 On Tuesday 07 August 2012 16:04:17 Jacques Fourie wrote: > On Tue, Aug 7, 2012 at 3:53 PM, 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. > > > > Eugene Grosbein > > _______________________________________________ > > freebsd-net@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-net > > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > > You can try using a VIMAGE enabled kernel and jails using epair(4) as > the network interface. Bridge the epair interfaces on the host to > igb0/igb1 and you should be able to communicate between the two jails > via igb0 and igb1. There's no need to use epair at all here. Just create a vnet jail, and assign one of the igb interfaces into it, done: # jail -c name=x vnet persist # ifconfig igb1 vnet x # jexec x ifconfig lo0: flags=8008 metric 0 mtu 16384 options=3 igb1: flags=8842<...> metric 0 mtu 1500 ... Marko