From owner-freebsd-net@FreeBSD.ORG Mon Apr 19 00:37:47 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 964F616A4CE for ; Mon, 19 Apr 2004 00:37:47 -0700 (PDT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9FAF43D31 for ; Mon, 19 Apr 2004 00:37:46 -0700 (PDT) (envelope-from ru@ip.net.ua) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i3J7frrP006416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Apr 2004 10:41:55 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.12.11/8.12.11) id i3J7bcxF040571; Mon, 19 Apr 2004 10:37:38 +0300 (EEST) (envelope-from ru) Date: Mon, 19 Apr 2004 10:37:38 +0300 From: Ruslan Ermilov To: Gleb Smirnoff , freebsd-net@freebsd.org Message-ID: <20040419073738.GD39799@ip.net.ua> References: <20040419003740.GB56442@cell.sick.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x4pBfXISqBoDm8sr" Content-Disposition: inline In-Reply-To: <20040419003740.GB56442@cell.sick.ru> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) Subject: Re: route into netgraph? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 07:37:47 -0000 --x4pBfXISqBoDm8sr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 19, 2004 at 04:37:40AM +0400, Gleb Smirnoff wrote: > Dear networkers, >=20 > does anyone can give me a hint? I want to inject some traffic with > a specific destination to netgraph. > For example I want to route all traffic with dst 10.0.0.0/8 to my > netgraph node, whereever it came from - came on interface or > generated locally. >=20 > I see only one way to do this - divert it with ipfw to ng_ksocket. >=20 > But, it'll be nice to use smth like: >=20 > route add 10.0.0.0/8 -iface ng0 >=20 > and receive packets on ng0's inet hook. >=20 > Any other ideas? >=20 So? The above should just work, what's the problem? # route add 10.0.0.0/8 -iface ng0 # ifconfig ng0 up # ping -c1 10.0.0.1 # nghook -a ng0: inet 0000: 45 00 00 54 07 d5 00 00 40 01 68 d4 00 00 00 00 E..T....@.h..... 0010: 0a 00 00 01 08 00 d9 8f 61 9e 00 00 c7 80 83 40 ........a......@ 0020: 79 0d 0e 00 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 y............... 0030: 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 ............ !"# 0040: 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 $%&'()*+,-./0123 0050: 34 35 36 37 4567 Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --x4pBfXISqBoDm8sr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAg4HCUkv4P6juNwoRAsaXAKCGJ3Z2T0WxWLTrlytCAkzC19tFlgCfQbHg HA2KyXPgCwL5gJF1vZYwJZA= =3xsi -----END PGP SIGNATURE----- --x4pBfXISqBoDm8sr--