标签:script system bond0 sla workman hit rest 桥接 mode
一.网卡绑定bond0配置mode=0,平衡负载模式,需要配置与网卡相连的交换机采取聚合模式。
配置mode=1,主备模式,无需配置交换机
配置 mode=6,平衡负载模式,但是不必配置交换机。
# modprobe --first-time bonding
# modinfo bonding
# systemctl stop NetworkManager
# systemctl disable NetworkManager
# cd /etc/sysconfig/network-scripts/
# cat ifcfg-ens33
DEVICE=ens33
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
# cat ifcfg-ens37
DEVICE=ens37
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
# cat ifcfg-bond0
DEVICE=bond0
NAME=bond0
TYPE=Bond
BONDING_MASTER=yes
IPADDR=192.168.7.17
PREFIX=24
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=balance-rr miimon=100"
GATEWAY=192.168.7.1
DNS1=192.168.17.1
DNS2=192.168.17.3
# systemctl restart network
查看bond情况:
参考文档:
https://www.kernel.org/doc/Documentation/networking/bonding.txt.
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-using_channel_bonding
# modprobe --first-time bridge
# modinfo bridge
# yum -y install bridge-utils
# cat ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BONDING_OPTS="mode=balance-rr miimon=100"
BRIDGE=brbond0
# cat ifcfg-brbond0
DEVICE=brbond0
TYPE=Bridge
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.7.17
PREFIX=24
GATEWAY=192.168.7.1
DNS1=192.168.17.1
DNS2=192.168.17.3
参考文档:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-network_bridging_using_the_command_line_interface
交换机上的端口必须设置成trunk模式
# modprobe --first-time 8021q
# modinfo 8021q
方法:
重启网卡:systemctl restart network
标签:script system bond0 sla workman hit rest 桥接 mode
原文地址:http://blog.51cto.com/dianel/2155246