码迷,mamicode.com
首页 > 其他好文 > 详细

centos6.6配置vlan三层交换

时间:2015-04-13 01:34:10      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:

编辑配置

/sbin/service network restart
/sbin/ip link add link eth0 name vlan2 type vlan id 2
/sbin/ip link add link eth0 name vlan3 type vlan id 3
/sbin/ip link add link eth0 name vlan4 type vlan id 4
/sbin/ip link add link eth0 name vlan5 type vlan id 5
/sbin/ip link add link eth0 name vlan6 type vlan id 6
/sbin/ip link add link eth0 name vlan7 type vlan id 7
/sbin/ip link add link eth0 name vlan8 type vlan id 8
/sbin/ip link set dev vlan2 up
/sbin/ip link set dev vlan3 up
/sbin/ip link set dev vlan4 up
/sbin/ip link set dev vlan5 up
/sbin/ip link set dev vlan6 up
/sbin/ip link set dev vlan7 up
/sbin/ip link set dev vlan8 up
/sbin/ip addr replace 10.86.1.17/28 dev vlan2
/sbin/ip addr replace 10.86.1.33/28 dev vlan3
/sbin/ip addr replace 10.86.1.49/28 dev vlan4
/sbin/ip addr replace 10.86.1.65/28 dev vlan5
/sbin/ip addr replace 10.86.1.81/28 dev vlan6
/sbin/ip addr replace 10.86.1.97/28 dev vlan7
/sbin/ip addr replace 10.86.1.113/28 dev vlan8
/sbin/sysctl net.ipv4.ip_forward=1
/sbin/service iptables restart
/sbin/iptables -t filter -I FORWARD -j ACCEPT
/sbin/ip route replace 10.86.1.128/28 via 10.86.1.116

 

centos6.6配置vlan三层交换

标签:

原文地址:http://www.cnblogs.com/firadio/p/4421090.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!