1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Linux网卡上配置vlan

Linux网卡上配置vlan

时间:2022-10-09 15:38:15

相关推荐

Linux网卡上配置vlan

作者:吴业亮

博客:wuyeliang.

操作系统:CentOS-7-x86_64-Everything-1804

[root@localhost ~]# lsmod | grep 8021q[root@localhost ~]# /sbin/modprobe -a 8021q[root@localhost ~]# cp /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-enp0s3.10[root@localhost ~]# cp /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-enp0s3.20[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-enp0s3.10PHYSDEV=enp0s3VLAN=yesTYPE=VlanVLAN_ID=10REORDER_HDR=yesGVRP=noMVRP=noBOOTPROTO=noneIPADDR=192.168.1.100PREFIX=24GATEWAY=192.168.1.1DEFROUTE=yesIPV4_FAILURE_FATAL=yesNAME=enp0s3.10ONBOOT=yes[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-enp0s3.20PHYSDEV=enp0s3VLAN=yesTYPE=VlanVLAN_ID=20REORDER_HDR=yesGVRP=noMVRP=noBOOTPROTO=noneIPADDR=192.168.1.200PREFIX=24GATEWAY=192.168.1.1DEFROUTE=yesIPV4_FAILURE_FATAL=yesNAME=enp0s3.20ONBOOT=yes[root@localhost ~]# systemctl restart network[root@localhost ~]# ifup enp0s3.10[root@localhost ~]# ifup enp0s3.20[root@localhost ~]# cat /proc/net/vlan/config 查看交换机配置是否成功

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。