Wednesday, 19 March 2014

How To - Set up 802.1q VLAN Tagging


Setting up 802.1q VLAN Tagging

Implementation Step(s)

1. Ensure that the module is loaded by entering the following command:
lsmod | grep 8021
Tip
If the module is not loaded, load it with the following command:

modprobe 8021

1.Configure your physical interface in /etc/sysconfig/network-scripts/ifcfg-ethX, where X is a unique number corresponding to a

specific interface, as follows:

DEVICE=ethX
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes{

1.Configure the VLAN interface configuration in /etc/sysconfig/network-scripts. The configuration filename should be the physical interface plus a . character plus the VLAN ID number. For example, if the VLAN ID is 1921, and the physical interface is eth0, then the configuration filename should be ifcfg-eth0.1921:

DEVICE=ethX.1921
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.1
NETMASK=255.255.255.0
USERCTL=no
NETWORK=192.168.1.0
VLAN=yes{
1. If there is a need to configure a second VLAN, with for example, VLAN ID 193, on the same interface, eth0 , add a new file with the name eth0.193 with the VLAN configuration details.
2. Restart the networking service, in order for the changes to take effect, as follows:

service network restart

1.     Create a VLAN device on the bond0 interface for VLAN 1921. and VLAN 2688

# echo "alias bond0 bonding" >> /etc/modprobe.conf
#vi /etc/sysconfig/network-scripts/ifcfg-bond0
# "<NETWORK DESCRIPTION>"
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MTU=1500
BONDING_OPTS="miimon=100 mode=1 use_carrier=1"
:wq

#vi /etc/sysconfig/network-scripts/ifcfg-bond0.1921
DEVICE=bond0.1921
IPADDR=10.117.244.7
NETMASK=255.255.255.224
ONBOOT=yes
BOOTPROTO=static
USERCTL=no
VLAN=yes

:wq

#vi /etc/sysconfig/network-scripts/ifcfg-bond0.2688
DEVICE=bond0.2688
IPADDR=10.117.116.185
NETMASK=255.255.255.224
ONBOOT=yes
BOOTPROTO=static
USERCTL=no
VLAN=yes
:wq

#ifconfig bond0 up
#ifconfig bond0.1921 up
#ifconfig bond0.2688 up

No comments:

Post a Comment