vlan 配置

RedHat上配置vlan:

~]$ modinfo 8021q
在ethX接口上配置vlan逻辑子接口:
DEVICE=ethX.192
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.1
PREFIX=24
NETWORK=192.168.1.0
VLAN=yes
DEVICE=ethX.192会自动关联到ethx上,如果不能则需要指定
PHYSDEV=ethx

采用cli:

~]# ip link add link eth0 name eth0.8 type vlan id 8

~]$ ip -d link show eth0.8
4: eth0.8@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT
     link/ether 52:54:00:ce:5f:6c brd ff:ff:ff:ff:ff:ff promiscuity 0
     vlan protocol 802.1Q id 8 <REORDER_HDR>

~]# ip link delete eth0.8
原文地址:https://www.cnblogs.com/allcloud/p/5544991.html