您的位置:首页 > 运维架构 > Linux

centos6.7vlan-tag

2016-02-29 20:56 330 查看
redhat7 官网配置参考:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Configure_802_1Q_VLAN_Tagging_Using_the_Command_Line.html

1, yum install -y vconfig
2, modprobe 8021q
lsmod | grep 8021q
3, 复制ifcfg-eth0到ifcfg-eth0.100,注意eth0是必须启用的,但不需要填写IP地址,就像交换机一样。
关键点:将ONBOOT设置为yes,将BOOTPROTO设置为none

DEVICE=ethX
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
4, 编辑ifcfg-eth0.4文件,将ONBOOT设置为yes,将BOOTPROTO设置为static或dhcp,
就像配置普通的网卡一样进行配置,配置结束后重启网络,利用ping检查网络是否畅通

DEVICE=ethX.192
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.1
PREFIX=24
NETWORK=192.168.1.0
VLAN=yes
5, /etc/init.d/network restart

6,echo "modprobe 8021q" >> /etc/rc.local
本文出自 “石头记” 博客,请务必保留此出处http://dodowolf.blog.51cto.com/793581/1746147
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: