Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Feb 2001 23:31:23 +0530 (IST)
From:      Satyajeet Seth <sseth@sasken.com>
To:        <net@freebsd.org>
Subject:   Re: Problem in configuring netgraph
Message-ID:  <Pine.GSO.4.30.0102272235130.13910-100000@suns3.sasi.com>
In-Reply-To: <3A9BA720.3AFB0A9@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <some machine in lan> &
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.30.0102272235130.13910-100000>