good-study

1、检查OS是否加载802.1q模块:

方法一:

[root@rs2 ~]# modinfo 8021q

 

方法二:

[root@rs2 ~]# modinfo -F filename 8021q

 

方法三:

[root@rs2 ~]# modprobe --first-time 8021q

 

 

2、如果没有加载如何加载802.1q模块:

[root@rs2 ~]# modprobe 8021q           ###加载模块

 

[root@rs2 ~]# lsmod | grep 8021q          ##检查模块是否正常加载

 

3、在父接口中创建子接口:

[root@rs2 ~]# cd /etc/sysconfig/network-scripts/

[root@rs2 network-scripts]# cp ifcfg-eno16777736 ifcfg-eno16777736.bak      ##备份网卡配置

 

[root@rs2 network-scripts]# vi ifcfg-eno16777736           #配置父接口

TYPE=Ethernet

BOOTPROTO=none

NAME=eno16777736

DEVICE=eno16777736

ONBOOT=yes

 

[root@rs2 network-scripts]# vi ifcfg-eno16777736.100         #配置子接口,100表示vid

BOOTPROTO=none

NAME=eno16777736.100

DEVICE=eno16777736.100

ONBOOT=yes

IPADDR=192.168.10.20

PREFIX=24

NETWORK=192.168.10.1

VLAN=yes                                    ###开启vlan,表示此接口为vlan接口

 

 

4、重启网络:

systemctl restart network

 

分类:

技术点:

相关文章:

  • 2022-03-07
  • 2022-03-09
  • 2021-11-23
  • 2022-01-15
  • 2021-12-09
  • 2022-01-24
  • 2022-02-28
猜你喜欢
  • 2021-05-29
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2021-10-03
相关资源
相似解决方案