From owner-freebsd-net@FreeBSD.ORG Wed Jun 17 06:24:20 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE3DF1065672 for ; Wed, 17 Jun 2009 06:24:20 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outF.internet-mail-service.net (outf.internet-mail-service.net [216.240.47.229]) by mx1.freebsd.org (Postfix) with ESMTP id D33478FC14 for ; Wed, 17 Jun 2009 06:24:20 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id B9D6BB094E; Tue, 16 Jun 2009 23:24:20 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 0741F2D600E; Tue, 16 Jun 2009 23:24:19 -0700 (PDT) Message-ID: <4A388C13.8050700@elischer.org> Date: Tue, 16 Jun 2009 23:24:19 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Bob Van Zant , FreeBSD Net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: Debugging a netgraph node 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: Wed, 17 Jun 2009 06:24:21 -0000 Bob Van Zant wrote: > I'm experimenting with netgraph to try to implement an IPv6 -> IPv4 gateway, > as specified here: > > http://tools.ietf.org/html/draft-xli-behave-ivi-02 hi bob, I can give you a hand if you want.. I'm busy tomorrow Morning but I can give you a call tomorrow afternoon if you like.. also, Joe in India has been using netgraph.. > > This is my first time ever working with netgraph and I admit to being a bit > lost. I have a netgraph node that gets wired up with an ng_ether node. My > lower hook gets wired to the ng_ether lower hook and my upper to his upper. > It's receiving IPv6 + UDP packets, creating IPv4 + UDP packets and then > writing the new packets out with NG_FWD_NEW_DATA. > > I'm perfectly willing to waste time making stupid mistakes on this project, > however, right now I'm stuck. I can't "find" the translated packets I'm > writing anywhere to see what, if anything, is wrong with them. They don't > show up in tcpdump on the local machine (I've tried writing to both the > upper and lower hook). They don't show up in tcpdump on other machines on > the network. > > I tried attaching nghook to the "orphans" hook of the ng_ether node but it > doesn't appear to be seeing any data. add a tee node between your node and the ether hook to see what you are sending. > > netstat -s -p udp doesn't show any packets when my node is enabled (I think > this means my node is effectively swallowing them). probably > > I've tried to figure out how to wire in an ng_tee node but I'm a little lost > as to how to do this (I still haven't figured out the ngctl syntax). ahh #add a tee to the ethernet lower hook ngctl mkpeer em3: tee lower left ngctl name em3:lower lowertee #then add your node to the right hook of the tee. ngctl mkpeer lowertee: mytype right lower ngctl name lowertee:right mynode #similar for the upper hook except that you use connect instead of #mkpeer for the last step as your node already exists. ngctl mkpeer em3: tee upper left mgctl name em3:upper uppertee ngctl connect uppertee: mynode: upper upper ------- now you can examine traffic on the two tee nodes let2right hook and rigt2left hook > > Any tips for figuring out what I'm doing wrong? Debug options to enable that > will show me more information about what's happening after I call > NG_FWD_NEW_DATA? If I got ng_tee wired in would it's tap hooks show me what > I want? A better way to try to tee the data? > > Thanks, > > Bob > > > _______________________________________________ > 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"