Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Feb 2001 09:26:03 +0530 (IST)
From:      Satyajeet Seth <sseth@sasken.com>
To:        <net@freebsd.org>
Subject:   Re: Problem in configuring netgraph
Message-ID:  <Pine.GSO.4.30.0102280831310.15014-100000@suns3.sasi.com>
In-Reply-To: <3A9BF6B7.703C3A3@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi

Please read my comments below:

> > 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 step 3.
>
> how different?

I experimented again and found that the packets printed by nghook
are same in step 3 and 7.

(i)For a few seconds, the first six bytes contained the MAC address of the
machine and the next six bytes contained the MAC address of the machine being
pinged.

(ii)After the few seconds the first six bytes contain all f's.  The
next six bytes contain varying MAC addresses.

I compared (i) for step 3 with (ii) for step 7 earlier.

> >
> > 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?
>
> because the incoming packets are still being diverted to the bpf node.

I mentioned in my previous mail but forgot to mention in this one that,
ngctl connect bpf0: fxp0: hook1 upper
was used before the ping in step 8.

Thanks
Satya


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.0102280831310.15014-100000>