Date: Fri, 2 May 2014 23:59:42 +0300 From: =?UTF-8?B?w5Z6a2FuIEtJUklL?= <ozkan.kirik@gmail.com> To: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Subject: Re: bridge Untagged packets on an interface Message-ID: <CAAcX-AE%2B-zmmsSkyixsZUecokyj0KOvS6zxyej27yHTseXN7mg@mail.gmail.com> In-Reply-To: <CAAcX-AGrSEN2e%2B0avN%2B54R47qF-5FGSKvCftwcMSmdyLN9es3A@mail.gmail.com> References: <CAAcX-AGrSEN2e%2B0avN%2B54R47qF-5FGSKvCftwcMSmdyLN9es3A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
And also i tried ng_bpf + ng_eiface conjuction, but ng_bpf doesnt match
"vlan" filter.
With the script below, ng_bpf always calls ifNotMatch hook. When the
pattern is "ip", ng_bpf matches frames have both vlan and ip headers.
I think ng_bpf doesnt process ethernet header. Is there a way to process
ethernet header with ng_bpf ?
Script is below:
#!/bin/sh
ETHER_IF=em0
PATTERN="vlan"
BPFPROG=$( tcpdump -s 8192 -ddd ${PATTERN} | \
( read len ; \
echo -n "bpf_prog_len=$len " ; \
echo -n "bpf_prog=[" ; \
while read code jt jf k ; do \
echo -n " { code=$code jt=$jt jf=$jf k=$k }" ; \
done ; \
echo " ]" ) )
echo $BPFPROG
# Shutdown nodes if exists
ngctl shutdown ${ETHER_IF}:
ngctl shutdown vlan_filter:
ngctl shutdown tag0:
ngctl shutdown untag0:
ngctl -f- <<EOF
mkpeer ${ETHER_IF}: bpf lower filter_in
name ${ETHER_IF}:lower vlan_filter
mkpeer vlan_filter: eiface taggedPacket ether
mkpeer vlan_filter: eiface untaggedPacket ether
name vlan_filter:taggedPacket tag0
name vlan_filter:untaggedPacket untag0
msg vlan_filter: setprogram { thisHook="filter_in" ifMatch="taggedPacket"
ifNotMatch="untaggedPacket" $BPFPROG }
EOF
ifconfig ngeth0 up
ifconfig ngeth1 up
On Fri, May 2, 2014 at 11:53 PM, Özkan KIRIK <ozkan.kirik@gmail.com> wrote:
> Hi,
>
> Assume that default vlan untagged and VLAN 10, 20, 30, 40 tagged on switch
> connected to em0 interface.
>
> i am trying to bridge only untagged frames on em0 with em1.
>
> Does if_vlan handle untagged frames?
>
> # ifconfig em0.0 create
> ifconfig: SIOCIFCREATE2: Invalid argument
>
> Any ideas?
>
> Best regards,
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAcX-AE%2B-zmmsSkyixsZUecokyj0KOvS6zxyej27yHTseXN7mg>
