1. lsmod|grep 8021q 確認內核是夠載入了802.1q模組
2.modprobe -a 8021q 如果沒載入使用這個命令載入模組
3.配置vlan需要vconfig命令,由於centos7上沒有自帶vconfig命令,所以需要安裝vconfig
配置epel源:yum install epel-release -y
安裝vconfig:yum install vconfig -y
4.創建兩個vlan:ens33.10和ens33.20
vconfig add ens33 10
vconfig add ens33 20
5.通過ip -a或者ifconfig -a查看。完成!