网卡绑定的作用:1、冗余,防止单点故障
2、防止传输瓶颈
1.交换机端口绑定:
system-view
link-aggregation group 1 mode manual 比如把端口1和2进行绑定 interface Ethernet1/0/1 #进入交换机1口
port link-aggregation group 1 #把当前端口加入汇聚组1
interface Ethernet1/0/2 #进入交换机2口
port link-aggregation group 1
2.系统网卡绑定
1.设置Bounding
vi /etc/modules.conf #添加以下内容
alias bond0 bonding
options bonding mode=1 miimon=200 primary=eth2 use_carrier=12. 加载bonding模块
modprobe bonding3.创建/修改bond0 eth0 eth1 配置文件
vi /et/sysconfig/network-ifcfg-“网卡名”DEVICE='bond0'
BOOTPROTO='static'
BROADCAST='x.x.x.x'
IPADDR='x.x.x.x'DEVICE=eth0
BOOTPROTO='static'
STARTMODE='onboot'DEVICE=eth1
BOOTPROTO='static'
STARTMODE='onboot'4.重启所有网卡
rcnetwork restart5.绑定eth0 eth1 到bond0
ifenslave bond0 eth0
ifenslave bond0 eth16.重启后自动加载设置:在/etc/init.d/中添加bonding启动文件
vi /etc/init.d/bonding #添加以下语句
case “$1” in
start)
/sbin/ifenslave bond0 eth0
/sbin/ifenslave bond0 eth1
;;
*)
;;
esac7.把加载bonding模块的脚本加入启动脚本中vi /etc/init.d/boot.local
modprobe bonding