龙蜥:anolisos 7.9系统网口启用vlan

龙蜥:anolisos 7.9系统网口启用vlan

背景说明:

1、加载8021q内核模块

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

[root@localhost ~]#  lsmod | grep -i 8021q
8021q                  33080  0 
garp                   14384  1 8021q
mrp                    18542  1 8021q

[root@localhost ~]#  modinfo 8021q

2、创建子接口及vlan封装

[root@localhost ~]# ip link add link ens6f0 name ens6f0.100 type vlan id 100
[root@localhost ~]# ip a

3. 启用子接口

[root@localhost ~]# ip link set ens6f0.100 up
[root@localhost ~]# ip a

4. 配置子接口IP

ip address add 172.27.100.47/24 dev ens6f0.100
ip address show ens6f0.100

重启后失效!

5、持久化子接口IP

[root@k8s-node ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens6f0.100 
BOOTPROTO=none
DEVICE=ens6f0.100
ONBOOT=yes
IPADDR=172.27.100.47
PREFIX=24
NETWORK=172.27.100.0
GATEWAY=172.27.100.1
VLAN=yes
DNS1=223.5.5.5

源接口

[root@k8s-node ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens6f0
TYPE=Ethernet
BOOTPROTO=none
DEVICE=ens6f0
ONBOOT=yes

重启网络生效

systemctl restart network

参考:https://blog.csdn.net/beeworkshop/article/details/109198589

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值