From owner-freebsd-net@FreeBSD.ORG Thu Nov 13 12:24:20 2003 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 6D37A16A4CF for ; Thu, 13 Nov 2003 12:24:20 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62EF043F3F for ; Thu, 13 Nov 2003 12:24:19 -0800 (PST) (envelope-from cristjc@comcast.net) Received: from blossom.cjclark.org (12-234-156-182.client.attbi.com[12.234.156.182]) by comcast.net (sccrmhc12) with ESMTP id <2003111320241801200s2it7e>; Thu, 13 Nov 2003 20:24:18 +0000 Received: from blossom.cjclark.org (localhost. [127.0.0.1]) by blossom.cjclark.org (8.12.9p2/8.12.8) with ESMTP id hADKOasb026646 for ; Thu, 13 Nov 2003 12:24:36 -0800 (PST) (envelope-from cristjc@comcast.net) Received: (from cjc@localhost) by blossom.cjclark.org (8.12.9p2/8.12.9/Submit) id hADKOa9X026645 for net@freebsd.org; Thu, 13 Nov 2003 12:24:36 -0800 (PST) (envelope-from cristjc@comcast.net) X-Authentication-Warning: blossom.cjclark.org: cjc set sender to cristjc@comcast.net using -f Date: Thu, 13 Nov 2003 12:24:35 -0800 From: "Crist J. Clark" To: net@freebsd.org Message-ID: <20031113202435.GA25920@blossom.cjclark.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-URL: http://people.freebsd.org/~cjc/ Subject: netgraph(4) divert(4) to UDP Tunnel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cjclark@alum.mit.edu List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2003 20:24:20 -0000 I'm trying to play around with netgraph(4) for the first time and there seem to be some aspects of it that haven't "clicked" in my head just yet. What I want to do seems like it should be pretty easy. I want to send some packets through a UDP tunnel. There is an /usr/share/examples/netgraph/udp.tunnel file that is close to what I want, but not quite. I want to send packets that have been divert(4)ed to the tunnel. I can make my two ng_ksocket(8) nodes via the ngctl(8) interface, + mkpeer ksocket d0 inet/dgram/udp + name d0 udptun + msg d0 bind inet/192.168.64.70:10000 + msg d0 connect inet/192.168.64.50:10000 + mkpeer ksocket d1 inet/raw/divert + name d1 divtun + msg d1 bind inet/0.0.0.0:8668 But how do I then connect the two of them up? I assume that I use 'connect' within ngctl(8), but I haven't figured out what the arguments need to be with the documentation and examples I've found. The other thing I suspect I should be doing, is actually running the 'mkpeer' through the first node I create in ngctl(8), but I can't seem to get that to work, + mkpeer ksocket d0 inet/dgram/udp + name d0 udptun + msg d0 bind inet/192.168.64.70:10000 + msg d0 connect inet/192.168.64.50:10000 + mkpeer d0 ksocket d1 inet/raw/divert ngctl: send msg: Socket is already connected I think it is actually complaining about the hook between my ngctl node and the udptun node and not the creation of the divert socket? Basically, I think my conceptual problem is with the fact that you start with the ngctl(8) node in the middle of everything. How do I create my new nodes and get the ngctl(8) node out of the middle? -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org