Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Apr 2018 09:46:12 -0700
From:      Freddie Cash <fjwcash@gmail.com>
To:        Eugene Grosbein <eugen@grosbein.net>
Cc:        Abdullah Tariq <ab.tariq90@gmail.com>, freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: NETGRAPH- bridge vlans using netgraph help
Message-ID:  <CAOjFWZ7AchG8HEvURSNGXGeqYiYaSn4Uo=rBgGoFqLAbAdOMJw@mail.gmail.com>
In-Reply-To: <5AE4D1AC.3080702@grosbein.net>
References:  <CAPFxuwQOBkGTHZbGfJz=-fUW8M%2BQGOpTM9T%2B-RO6H4fWcGEtqA@mail.gmail.com> <5AE216DC.7010905@grosbein.net> <CAPFxuwSEDTNhfn1%2B1nXPAC6skJt%2BdAych10FN9bwwBVdqevO2w@mail.gmail.com> <5AE33513.1000001@grosbein.net> <CAPFxuwRceDDoTw-4EohRdjUMSE-YN4YKWhbObuvEpxzEWOh2_A@mail.gmail.com> <5AE34754.6040905@grosbein.net> <CAPFxuwQ5TwZnnW%2B1TT7urq_0pgb=sM_VwH4x0eq0363MCdb7hw@mail.gmail.com> <5AE34CFA.7000207@grosbein.net> <CAPFxuwR54nPiKAAACRY5a_GvDNOVfdniqv6F_3PK4--7vm03uA@mail.gmail.com> <5AE437C1.8010706@grosbein.net> <CAFZYVy7_nVm5G1XDdM_TujN=jVbCyDEKABGbC=M9L5Lh1jAAzQ@mail.gmail.com> <5AE44ADD.7020302@grosbein.net> <CAPFxuwQ=Gi7GiVr%2BsdTavr6r44ftaeFDOvN7%2B3qi_7aZyH6kXw@mail.gmail.com> <5AE468D5.9030702@grosbein.net> <CAPFxuwRdLrEmtVHGSruja6L-bcOi0Z59ae5mB1gWgi-PvU6inw@mail.gmail.com> <CAOjFWZ6m=j6aY7nbeppCK9TTAJ1P%2BfN7Hs5sZ3CfWc7Ad4v_cA@mail.gmail.com> <CAOjFWZ62BQ3WZVvpZ0D9UJFcV4stXm-prE=GDp-JconSktQzpA@mail.gmail.com> <5AE4D1AC.3080702@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 28, 2018 at 12:55 PM, Eugene Grosbein <eugen@grosbein.net>
wrote:

> 28.04.2018 21:57, Freddie Cash wrote:
>
> > If you want to think of it in switch terms, FreeBSD supports access
> ports (untagged vlan) and trunk ports (tagged vlans).
> > But there's no support for hybrid ports (tagged vlans with a PVID on th=
e
> port that adds tags to untagged traffic).
>
> Not entirely correct. As FreeBSD is not a switch, it by default does not
> have nor need PVID notion at.
> However, FreeBSD still can bridge incoming untagged frames with arbitrary
> interface vlan.
>

=E2=80=8BWhat you wrote doesn't conflict with anything I said.

You can have two interfaces, one configured directly (igb0), the other
configured for a tagged vlan (vlan5 using igb1), and bridge them together
to pass traffic between interfaces, yes.  Nothing I wrote says you can't.
Nor is this what the OP wants.

You can't configure an interface in FreeBSD with vlan X, and accept
untagged packets on that interface, and have those incoming packets tagged
with vlan X after being received.  (aka a hybrid port with a PVID set)
Note:  a single interface.

What the OP is trying to do is have PC1 send untagged packets to igb0 on
FreeBSD which is configured for tagged vlan 5.  Then bridge the packets to
igb1 which is also configured for tagged vlan 5.  Then send the packets
out, untagged, to PC2.

With a switch, this is easy to do.  You just mark the two ports as being
part of untagged vlan 5 and you are done.  FreeBSD doesn't have a concept
of "untagged vlan 5" as there's no concept of a PVID on an interface.

Maybe there's a way to do this via a virtual switch like openvswitch or
VALE or similar (or maybe by mangling the packets via netgraph?), but that
gets overly complicated and brittle, and is something better suited to a
proper managed switch.  Or to configuring PC1 and PC2 to send tagged
packets.  Or any other number of ways of properly configuring the network
instead of trying to twist FreeBSD's network stack into shapes it was never
meant to support.

=E2=80=8BNote:  this is knowledge gained from trying to configure interface=
s to
work with tagged and untagged vlans and things going wonky and then some
(on FreeBSD and Linux, but the Linux side of things is horrible as you can
actually mix tagged and untagged vlans on an interface but it just breaks
things in weird and wonderful ways due to the way they pass tags around the
stack).  I haven't actually looked at the network stack code, so maybe
there's a way to make this work, but in-the-field experience says it can't.=
=E2=80=8B

--=20
Freddie Cash
fjwcash@gmail.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOjFWZ7AchG8HEvURSNGXGeqYiYaSn4Uo=rBgGoFqLAbAdOMJw>