Subject: Re: VLAN 1 - Native

From: Michal Soltys <[email-masked]>
Date: Wed, 01 Feb 2012 20:26:53 +0100

On 12-02-01 17:44, Leonardo Uzcudun wrote:
> I'm sorry guys but i'm not understanding. Allow me to ask in a different way.
>
> I've a linux computer with 3 network cards (eth0, eth1 and eth2)
>
> eth0 is connected to a switch with vlans config.
> eth1 is connected to a network that has VID 1
> eth2 is connected to a network that has VID 101
>

Assuming you have:

eth0: 1u 101t
eth1: 1u
eth2: 101u

would this work for you ?:

ip link add link eth0 name eth0.101 type vlan id 101
ebtables -t broute -A BROUTING -i eth0 --vlan-id 101 -j DROP
brctl addbr br_vlan_1
brctl addbr br_vlan_101
brctl addif br_vlan_1 eth0 eth1
brctl addif br_vlan_101 eth0.101 eth2

ebtables should make 101 tagged traffic go through br_vlan_101 instead 
of br_vlan_1

I think there's also option for doing it with single bridge interface 
and some more complex ebtables rules, but the above if I didn't miss 
anything, should work fine.