From owner-freebsd-net@FreeBSD.ORG Tue Aug 7 14:04:18 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BBBEF106564A for ; Tue, 7 Aug 2012 14:04:18 +0000 (UTC) (envelope-from jacques.fourie@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 733FC8FC14 for ; Tue, 7 Aug 2012 14:04:18 +0000 (UTC) Received: by qcsg15 with SMTP id g15so3043587qcs.13 for ; Tue, 07 Aug 2012 07:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/MaUpGyZPCBukYN0B7/IjEsZac9Rx0qzj297C42KXyM=; b=PS8GZHlqdCEnF89ov36a1C3afmBW0VbVQ4hr5O+vwyPxy9ja/2s3+sD3IHxXvZIgF4 8OGv/Ai58r7aQXTgGkoXfDNzXWhh/aamMUmXDUIIUeoSn4pm6vinasRkjiLaRbkGUszY hDIIN2r10QBxBc1DmSoDPemHbLeOZx0jk0DnxlRUIbTw3UUNJAyGZ37tVBnVXAlpEon8 LWWAJOhb2UhPF7JWz5qnoV7nouzIJ+2sxKx/jj6/qpb6qQcx669aI67UDh8KwarU3wPJ EegLd5jyhccfkyF2mv0yjdpgFL8eUpIhpmbwiNqmwl6JhNWYhe0PMDQKzv6vd30R5G7M XVHA== MIME-Version: 1.0 Received: by 10.229.135.11 with SMTP id l11mr7100333qct.116.1344348257671; Tue, 07 Aug 2012 07:04:17 -0700 (PDT) Received: by 10.229.38.210 with HTTP; Tue, 7 Aug 2012 07:04:17 -0700 (PDT) In-Reply-To: <50211DF0.2090607@rdtc.ru> References: <50211DF0.2090607@rdtc.ru> Date: Tue, 7 Aug 2012 16:04:17 +0200 Message-ID: From: Jacques Fourie To: Eugene Grosbein Content-Type: text/plain; charset=ISO-8859-1 Cc: "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:04:18 -0000 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.