Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Aug 2012 11:37:35 -0400
From:      Jason Hellenthal <jhellenthal@dataix.net>
To:        Eugene Grosbein <egrosbein@rdtc.ru>
Cc:        "net@freebsd.org" <net@freebsd.org>
Subject:   Re: Send traffic to itself using real NIC
Message-ID:  <20120807153735.GA98926@DataIX.net>
In-Reply-To: <50211DF0.2090607@rdtc.ru>
References:  <50211DF0.2090607@rdtc.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--5vNYLRcllDrimb99
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 07, 2012 at 08:53:52PM +0700, Eugene Grosbein wrote:
> Hi!
>=20
> I'd like to run some stability tests for some L2-transparent
> gigabit ethernet network hardware I've got.
>=20
> 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.
>=20
> 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?
>=20
> I've tried to utilize multiple FIBs:
>=20
> sysctl net.add_addr_allfibs=3D0
> 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
>=20
> But "setfib 1 ping -S 10.0.0.1 10.0.1.1" still runs via lo0 (and has no a=
nswer).
>=20
> 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).
>=20
> I would really like using normal TCP/UDP/ICMP streams in addition of ng_s=
ource tests.
>=20

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.

--=20

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


--5vNYLRcllDrimb99
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJQITY/AAoJEBSh2Dr1DU7WwXMIAKIeNukM9Mt2U9W3SOpmEWAb
x+txwu3KGZaDaWr4EENC/hSdlQnELNQ1YisnJjT83mWz8Pk4pclYcNYY86mDaTeP
Ubd/2ADTxLUkXK82r/cEOxjD2SywfjFFCjLay7Q0K2Ne/aO6LpMCB24Ebn38ngbE
4XsxeJjpQVSxiAxpui6rAA/ybJSRTMdjQeeEu9ywFZ9XuYWXa3U2UZB5yMZTyr7q
M7bwWlG60m6cps1ADNOaUutIK9iIeRlL+fpYUU1lkWhtbUgi67FeIZ39/a7Dry/Q
Pi2/hB/92MG7mGfzhkBW2JyWFG3l10EQKknNE7NrsmuNMQaPS7qkpcfCcyuoCUk=
=nkdG
-----END PGP SIGNATURE-----

--5vNYLRcllDrimb99--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120807153735.GA98926>