How to make bridge over VLAN?
Bridging over VLAN's :
By constructing a bridge between a "normal" and a "VLAN" ethernet interface, the Linux computer will add and remove the VLAN headers on behalf of any other device(s) plugged into the "normal" card.
How :
Okay, now for the tricky part. It takes a slight modification of the procedures above. For this example, let's presume we have an Ethernet interface eth0 connected to the network where a VLAN id 2 is present, and we have a device or devices on eth1 that need to be bridged into that VLAN 2.
Go ahead and first construct the VLAN interface like we did before (copy ifcfg-eth#, change DEVICE, add VLAN=yes), except also remove the BOOTPROTO, IPADDR, NETMASK, and GATEWAY lines if present. Add a line BRIDGE=br2 (or a different named bridge device of your choice).
1. vi /etc/sysconfig/network-scripts/ifcfg-eth0.2 (connected to VLAN2)
---
DEVICE=eth0.2
VLAN=yes
TYPE=Ethernet
HWADDR=##:##:##:##:##:##
ONBOOT=yes
BRIDGE=br2
----
2. vi /etc/sysconfig/network-scripts/ifcfg-eth1
--
DEVICE=eth1
TYPE=Ethernet
WADDR=##:##:##:##:##:##
ONBOOT=yes
BRIDGE=br2
---
3. vi /etc/sysconfig/network-scripts/ifcfg-br2
----
DEVICE=br2
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.2.24
NETMASK=255.255.255.0
GATEWAY=192.168.2.254
DELAY=0
STP=off
---
Note : IP address has in br2
4. service network restart. That's it.
Try :)
Bridging over VLAN's :
By constructing a bridge between a "normal" and a "VLAN" ethernet interface, the Linux computer will add and remove the VLAN headers on behalf of any other device(s) plugged into the "normal" card.
How :
Okay, now for the tricky part. It takes a slight modification of the procedures above. For this example, let's presume we have an Ethernet interface eth0 connected to the network where a VLAN id 2 is present, and we have a device or devices on eth1 that need to be bridged into that VLAN 2.
Go ahead and first construct the VLAN interface like we did before (copy ifcfg-eth#, change DEVICE, add VLAN=yes), except also remove the BOOTPROTO, IPADDR, NETMASK, and GATEWAY lines if present. Add a line BRIDGE=br2 (or a different named bridge device of your choice).
1. vi /etc/sysconfig/network-scripts/ifcfg-eth0.2 (connected to VLAN2)
---
DEVICE=eth0.2
VLAN=yes
TYPE=Ethernet
HWADDR=##:##:##:##:##:##
ONBOOT=yes
BRIDGE=br2
----
2. vi /etc/sysconfig/network-scripts/ifcfg-eth1
--
DEVICE=eth1
TYPE=Ethernet
WADDR=##:##:##:##:##:##
ONBOOT=yes
BRIDGE=br2
---
3. vi /etc/sysconfig/network-scripts/ifcfg-br2
----
DEVICE=br2
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.2.24
NETMASK=255.255.255.0
GATEWAY=192.168.2.254
DELAY=0
STP=off
---
Note : IP address has in br2
4. service network restart. That's it.
Try :)