- lsmod|grep 8021q 確認(rèn)內(nèi)核是夠載入了802.1q模組
2.modprobe -a 8021q 如果沒載入使用這個(gè)命令載入模組

image
3.配置vlan需要vconfig命令,由于centos7上沒有自帶vconfig命令,所以需要安裝vconfig
配置epel源:yum install epel-release -y
安裝vconfig:yum install vconfig -y
4.創(chuàng)建兩個(gè)vlan:ens33.10和ens33.20
vconfig add ens33 10
vconfig add ens33 20

image
5.通過ip -a或者ifconfig -a查看。完成!

image