From owner-freebsd-net@FreeBSD.ORG Fri May 26 21:24:48 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org 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 4CC3A16B9D9 for ; Fri, 26 May 2006 21:24:48 +0000 (UTC) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8D1E43D7D for ; Fri, 26 May 2006 21:24:47 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.23.205]) ([10.251.23.205]) by a50.ironport.com with ESMTP; 26 May 2006 14:24:47 -0700 Message-ID: <4477721F.2010406@elischer.org> Date: Fri, 26 May 2006 14:24:47 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.13) Gecko/20060414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: benjamin@cactus.org References: <20060526191656.GA15237@linux.cactus.org> In-Reply-To: <20060526191656.GA15237@linux.cactus.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Netgraph: Ethernet interfaces missing from persistent node list 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: Fri, 26 May 2006 21:24:55 -0000 benjamin@cactus.org wrote: >Using ngctl as suggested in the "All About Netgraph" Daemon News >article (http://people.freebsd.org/~julian/netgraph.html ) by Archie >Cobbs I get the following output: > >root@ntp-2# nghook -a fxp0: divert >nghook: can't connect to node > >root@ntp-2# ngctl list >There are 1 total nodes: > Name: ngctl4352 Type: socket ID: 00000005 Num hooks: 0 > >According to the article my four Ethernet interefaces (see ifconfig output below) should display >as persistent nodes. Any reason why they do not appear? I compiled a custom kernel on two separate >occasions, first to support IPFW/Dummynet, then later, Netgraph. > >Thanks, >Tom Benjamin > >##### kernel options added for 1st compile (IPFW) >options BRIDGE >options IPFIREWALL >options IPFIREWALL_VERBOSE >options IPFIREWALL_VERBOSE_LIMIT >options DUMMYNET >options NMBCLUSTERS >options HZ=1000 >##### kernel options added for 2nd compile (NETGRAPH, plus forgot IPDIVERT in 1st compile) >options IPDIVERT >options NETGRAPH > > You need to also compile in or load the nodes you need. options NETGRAPH_ETHER (I think) (I forget the names.. look in LINT) or kldload ng_ether to load it dynamically also, there is no "divert" hook for ng_ether hooks. hooks for ng-ether are: lower (to get incoming packets and accept outgoing packets )(connects to the physical interface) upper (to get outgoing packets and acceept incoming packets)(connects to the protocol mux/demux) orphan (above the protocol demux. only gives you packets that would otherwise have been discarded due to not being a known protocol.) man 4 ng_ether >##### end kernel options > ># uname -a >FreeBSD ntp-2.labs.iptv 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu May 25 14:34:57 CDT 2006 > >root@ntp-2# sysctl -a|grep graph >netgraph_path 0 0K - 30 16 >netgraph_sock 0 0K - 5 64 >netgraph_msg 0 0K - 30 64,128,256,1024 >netgraph_node 0 0K - 5 256 >net.graph.maxalloc: 512 >net.graph.abi_version: 11 >net.graph.msg_version: 8 >net.graph.control.proto: 2 >net.graph.data.proto: 1 >net.graph.family: 32 >net.graph.recvspace: 20480 >net.graph.maxdgram: 20480 > ># ifconfig >fxp0: flags=8843 mtu 1500 > options=8 > inet6 fe80::2b0:d0ff:fee1:1754%fxp0 prefixlen 64 scopeid 0x1 > inet 192.168.10.1 netmask 0xffffff00 broadcast 192.168.10.255 > ether 00:b0:d0:e1:17:54 > media: Ethernet autoselect (100baseTX) > status: active >fxp1: flags=8843 mtu 1500 > options=8 > inet6 fe80::2b0:d0ff:fee1:1755%fxp1 prefixlen 64 scopeid 0x2 > inet 10.3.40.250 netmask 0xffffff00 broadcast 10.3.40.255 > ether 00:b0:d0:e1:17:55 > media: Ethernet autoselect (100baseTX ) > status: active >sis0: flags=8843 mtu 1500 > options=8 > inet6 fe80::20f:b5ff:fe46:8e17%sis0 prefixlen 64 scopeid 0x3 > inet 144.60.43.147 netmask 0xffffff00 broadcast 144.60.43.255 > ether 00:0f:b5:46:8e:17 > media: Ethernet autoselect (100baseTX ) > status: active >sis1: flags=8842 mtu 1500 > options=8 > ether 00:0f:b5:46:59:63 > media: Ethernet autoselect (100baseTX ) > status: active >lo0: flags=8049 mtu 16384 > inet6 ::1 prefixlen 128 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 > inet 127.0.0.1 netmask 0xff000000 >netgraph_24may2006.txt >netgraph_26may2006.txt > >