双网卡绑定

来源:互联网 发布:神仙道 源码 编辑:程序博客网 时间:2024/06/05 18:35
双网卡绑定
两块或以上物理网卡:
[root@myrhel ~]# ifconfig -a


[root@myrhel ~]# lspci |grep Eth
02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
02:05.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)


关闭NetworkManager
[root@myrhel ~]# service NetworkManager stop
Stopping NetworkManager daemon: [  OK  ]
开机不启动NetworkManager
[root@myrhel ~]# chkconfig NetworkManager off


主卡配置文件:
cd /etc/sysconfig/network-scripts/


cp ifcfg-eth0 ifcfg-bond0


vim ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
DNS1=192.168.0.254
GATEWAY=192.168.0.254
IPADDR=192.168.0.123
NETMASK=255.255.255.0
ONBOOT=yes
BONDING_OPTS="mode=1 miimon=100"   //mode  模式0 轮循  模式1 主备份  模式3 广播 模式4802.3ad 链路聚合  miiloon=100 每100毫秒检查一次网卡状态

vim ifcfg-eth0 物理卡1配置文件
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
cat ifcfg-eth1 物理卡2配置文件
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes

cd /etc/modprobe.d/
touch bonding.conf
  vim bonding.conf 逻辑卡bond0的内核模块驱动
alias bond0 bonding


service network restart                 重启网络
0 0