实现linux操作系统的多网卡绑定

几种模式

mode=0 (round-robin)

mode=1 (active-backup)

mode=2 (balance-xor)

mode=3 (broadcast)

 

1. 首先需要彻底关闭NetworlManger 服务,否则会和bond网卡冲突
chkconfig NetworlMangeroff

modprobe bonding 调用

 

modinfo bonding 查看内存当中加载的模块

实现linux操作系统的多网卡绑定_blank

2 进入 /etc/sysconfig/network-scripts 文件下

 

编辑 ifcfg-eth0

vim ifcfg-eth0

 

实现linux操作系统的多网卡绑定_操作系统_02

 

编辑 ifcfg-eth1

vim ifcfg-eth1

 

实现linux操作系统的多网卡绑定_blank_03

3

建立编辑ifcfg-bond0文件

cp ifcfg-eth0 ifcfg-bond0

vim ifcfg-bond0

 

实现linux操作系统的多网卡绑定_blank_04

4 编辑模块的配置文件

vim /etc/modprobe.conf

 

实现linux操作系统的多网卡绑定_网卡_05

 

5 放入开机脚本

编辑 /etc/rc.local

vim /etc/rc.local

 

实现linux操作系统的多网卡绑定_网卡_06

 

6 重启计算机

Init 6

7 查看内核当中的网卡绑定

Ifconfig |less

 

实现linux操作系统的多网卡绑定_网卡_07

cat /proc/net/bonding/bond0

 

模式0

实现linux操作系统的多网卡绑定_target_08

模式1

 

编辑 /etc/modprobe.conf

实现linux操作系统的多网卡绑定_target_09

cat /proc/net/bonding/bond0

实现linux操作系统的多网卡绑定_网卡_10