From owner-freebsd-net@FreeBSD.ORG Mon Apr 19 02:28:05 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 6910A16A4CF; Mon, 19 Apr 2004 02:28:05 -0700 (PDT) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DF9E43D2F; Mon, 19 Apr 2004 02:28:04 -0700 (PDT) (envelope-from glebius@cell.sick.ru) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.9/8.12.8) with ESMTP id i3J9S2QE058201 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Apr 2004 13:28:02 +0400 (MSD) (envelope-from glebius@cell.sick.ru) Received: (from glebius@localhost) by cell.sick.ru (8.12.9/8.12.6/Submit) id i3J9S1aj058200; Mon, 19 Apr 2004 13:28:01 +0400 (MSD) Date: Mon, 19 Apr 2004 13:28:01 +0400 From: Gleb Smirnoff To: Ruslan Ermilov Message-ID: <20040419092801.GB58113@cell.sick.ru> Mail-Followup-To: Gleb Smirnoff , Ruslan Ermilov , freebsd-net@freebsd.org References: <20040419003740.GB56442@cell.sick.ru> <20040419073738.GD39799@ip.net.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20040419073738.GD39799@ip.net.ua> User-Agent: Mutt/1.5.6i cc: freebsd-net@freebsd.org 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 09:28:05 -0000 On Mon, Apr 19, 2004 at 10:37:38AM +0300, Ruslan Ermilov wrote: R> > does anyone can give me a hint? I want to inject some traffic with R> > a specific destination to netgraph. R> > For example I want to route all traffic with dst 10.0.0.0/8 to my R> > netgraph node, whereever it came from - came on interface or R> > generated locally. R> > R> > I see only one way to do this - divert it with ipfw to ng_ksocket. R> > R> > But, it'll be nice to use smth like: R> > R> > route add 10.0.0.0/8 -iface ng0 R> > R> > and receive packets on ng0's inet hook. R> > R> > Any other ideas? R> > R> So? The above should just work, what's the problem? R> R> # route add 10.0.0.0/8 -iface ng0 R> # ifconfig ng0 up R> # ping -c1 10.0.0.1 R> R> # nghook -a ng0: inet R> 0000: 45 00 00 54 07 d5 00 00 40 01 68 d4 00 00 00 00 E..T....@.h..... R> 0010: 0a 00 00 01 08 00 d9 8f 61 9e 00 00 c7 80 83 40 ........a......@ R> 0020: 79 0d 0e 00 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 y............... R> 0030: 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 ............ !"# R> 0040: 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 $%&'()*+,-./0123 R> 0050: 34 35 36 37 4567 Ah, yes. May be yesterday I was on smth. Surely it works. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE