Setting Up 802.1q VLAN Tagging
-
Ensure that the module is loaded by entering the following command:
lsmod | grep 8021q -
If the module is not loaded, load it with the following command:
modprobe 8021q -
Configure your physical interface in
/etc/sysconfig/network-scripts/ifcfg-eth, whereXXis a unique number corresponding to a specific interface, as follows:DEVICE=ethX TYPE=Ethernet BOOTPROTO=none ONBOOT=yes
-
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 192, and the physical interface iseth0, then the configuration filename should beifcfg-eth0.192:DEVICE=ethX.192 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.1.1 NETMASK=255.255.255.0 USERCTL=no NETWORK=192.168.1.0 VLAN=yes
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 nameeth0.193with the VLAN configuration details. -
Restart the networking service, in order for the changes to take effect by running as
root:systemctl restart network.service
example:
#vconfig add p34p1 500
#ifconfig p34p1.500
#remove it
#vconfig rem p34p1.500
文章標籤
全站熱搜
