Linux如何在一个bond中配置多个vlan
交换机做trunk模式
配置好bond0
HCS: # cd /etc/sysconfig/network/scripts/
检查内核要支持VLAN功能:
HCS:/etc/sysconfig/network/scripts # dmesg | grep -i VLAN
确认802.1q模块加载:
HCS:/etc/sysconfig/network/scripts # lsmod | grep 8021q
使用vconfig命令增加子接口:
HCS:/etc/sysconfig/network/scripts # vconfig add bond0 100
Added VLAN with VID == 100 to IF -:bond0:-
HCS:/etc/sysconfig/network/scripts # vconfig add bond0 200
Added VLAN with VID == 200 to IF -:bond0:-
配置接口IP:(配置在network/目录下)
HCS:/etc/sysconfig/network # cat ifcfg-vlan100
DEVICE='vlan100'
ETHERDEVICE='bond0'
STARTMODE='auto'
IPADDR='172.16.1.21'
NETMASK='255.255.255.0'
HCS:/etc/sysconfig/network # cat ifcfg-bond0.200
DEVICE='vlan200'
ETHERDEVICE='bond0'
STARTMODE='auto'
IPADDR='172.16.1.21'
NETMASK='255.255.255.0'
检查生效
bond0.100 Link encap:Ethernet HWaddr 00:0C:29:2E:F6:E0
inet addr:172.16.1.22 Bcast:172.16.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe2e:f6e0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:468 (468.0 b)
bond0.200 Link encap:Ethernet HWaddr 00:0C:29:2E:F6:E0
inet addr:172.16.1.21 Bcast:172.16.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe2e:f6e0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
- 点赞
- 收藏
- 关注作者
评论(0)