Thursday, June 30, 2011

How to make bridge over VLAN?

■ Requirement : create bridge over vlan
■ OS Environment : Linux[RHEL, Centos]
■ Application:vlan, bridge
■ Implementation Steps :

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.

           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. edit /etc/sysconfig/network-scripts/ifcfg-eth0.2 (connected to VLAN2)

DEVICE=eth0.2
VLAN=yes
TYPE=Ethernet
HWADDR=##:##:##:##:##:##
ONBOOT=yes
BRIDGE=br2

2. edit /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
TYPE=Ethernet
HWADDR=##:##:##:##:##:##
ONBOOT=yes
BRIDGE=br2

3. edit /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

4. service network restart. 


No comments:

Post a Comment