From owner-freebsd-net Tue Feb 27 10: 1:41 2001 Delivered-To: freebsd-net@freebsd.org Received: from samar.sasi.com (samar.sasken.com [164.164.56.2]) by hub.freebsd.org (Postfix) with ESMTP id 9FD8E37B71A for ; Tue, 27 Feb 2001 10:01:32 -0800 (PST) (envelope-from sseth@sasken.com) Received: from samar (samar.sasi.com [164.164.56.2]) by samar.sasi.com (8.9.3/8.9.3) with SMTP id XAA24001 for ; Tue, 27 Feb 2001 23:31:25 +0530 (IST) Received: from suns3.sasi.com ([10.0.36.3]) by samar.sasi.com; Tue, 27 Feb 2001 23:31:24 +0000 (IST) Received: from localhost (sseth@localhost) by suns3.sasi.com (8.9.3/8.9.3) with ESMTP id XAA14132 for ; Tue, 27 Feb 2001 23:31:23 +0530 (IST) Date: Tue, 27 Feb 2001 23:31:23 +0530 (IST) From: Satyajeet Seth To: Subject: Re: Problem in configuring netgraph In-Reply-To: <3A9BA720.3AFB0A9@elischer.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi I tried the example at: http://www.freebsd.org/cgi/cvsweb.cgi/src/share/man/man4/ng_bpf.4 When I type: tcpdump -ddd ether dest xx:xx:xx:xx:xx:xx in a telnet session the command gave the raw BPF instructions, as expected. However, at the system console the same command gave the message: fxp0: promiscuous mode enabled tcpdump: syntax error xp0: promiscuous mode disabled Could you suggest what could be wrong? I also tried the following: 1. reboot 2. ping -f & 3. nghook -a fxp0: lower Now I get identical packets. 4. ngctl mkpeer fxp0: bpf divert bhook 5. ngctl name fxp0:divert bpf0 6. ngctl msg bpf0: setprogram { thisHook="bhook" ifMatch="hook2" ifNotMatch="hook1" bpf_prog_len=1 bpf_prog=[ { code=6 } ] } Now all the packets are sent to hook1. 7. nghook -a bpf0: hook1 gives packets differing from point 3. 8. ping to any machine on the lan does not work. By default the upper and lower hooks of fxp0 are effectively connected. Our setup also does the same. Could you suggest why the ping does not work? Thanks Satya > > I tried to use ng_ether and ng_bpf as follows: > > > > fxp0(lower) --- (bhook)[bpf](nomatch)(hook1)----(upper)fxp0 > > [ ]( match )(hook2)----not connected > > > > $ ngctl mkpeer fxp0: bpf divert bhook > > > > $ ngctl name fxp0:divert bpf0 > > > > $ ngctl > > + msg bpf0: setprogram { thisHook="bhook" ifMatch="hook2" > > ifNotMatch="hook1" bpf_prog_len=1 bpf_prog=[ { code=6 } ] } > > > > Now 'nghook -a bpf0: hook1' shows output while 'nghook -a bpf0: hook2' > > doesn't. > > > > $ ngctl connect fxp0: bpf0: upper hook1 > > > > After this I am unable to ping any of the lan machines. > > Could you suggest what I could be doing wrong? > > > > I am using FreeBSD 4.1. > > the man page for -current ng_bpf (you can get it from > http://www.freebsd.org/cgi/cvsweb.cgi/src/share/man/man4/ng_bpf.4 > > shows how to program a bpf node with a good example > (it was not in the 4.x man page) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message