将多个物理网卡进行排列组合,形成逻辑网卡,网卡的高可用
| mode0(平衡负载模式):平时两块网卡均工作,且自动备援,但需要在与服务器本地 网卡相连的交换机设备上进行端口聚合来支持绑定技术。 |
| mode1(自动备援模式):平时只有一块网卡工作,在它故障后自动替换为另外的网卡。 |
| mode1(自动备援模式):平时只有一块网卡工作,在它故障后自动替换为另外的网卡。 |
首先服务器准备两块网卡

配置我们的网卡

- ##编辑ens160
-
- vim /etc/sysconfig/network-scripts/ifcfg-ens160
- TYPE=Ethernet
- BOOTPROTO=none
- NAME=ens160
- DEVICE=ens160
- ONBOOT=yes
- MASTER=bond0
- SLAVE=yes
-
- ###编辑ens224
-
- vim /etc/sysconfig/network-scripts/ifcfg-ens224
- TYPE=Ethernet
- BOOTPROTO=none
- NAME=ens224
- DEVICE=ens224
- ONBOOT=yes
- MASTER=bond0
- SLAVE=yes
-
- ###编辑bond0,根据自己的情况配置相应的IP、网关、DNS
- TYPE=Ethernet
- BOOTPROTO=none
- NAME=bond0
- DEVICE=bond0
- ONBOOT=yes
- IPADDR=192.168.115.100
- PREFIX=24
- GATEWAY=192.168.115.150
- DNS1=8.8.8.8
-
- #添加bond配置文件
-
- vim /etc/modprobe.d/bond.conf
-
- #插入
- alias bond0 bonding
- options bonding mode=6 miimon=200
-
-
-
- ##关闭网络图形化服务
- systemctl stop NetworkManager
-
-
-
- ###加载模块
- insmod /usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/net/bonding/bonding.ko.xz
-
- 或者 modprobe bonding

- 重启网卡
- systemctl restart network

查看绑定结果
- cat /proc/net/bonding/bond0
-
-
- Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
-
- Bonding Mode: load balancing (round-robin)
- MII Status: up
- MII Polling Interval (ms): 0
- Up Delay (ms): 0
- Down Delay (ms): 0
-
- Slave Interface: ens160
- MII Status: up
- Speed: 10000 Mbps
- Duplex: full
- Link Failure Count: 0
- Permanent HW addr: 00:0c:29:3f:e8:9e
- Slave queue ID: 0
-
- Slave Interface: ens224
- MII Status: up
- Speed: 10000 Mbps
- Duplex: full
- Link Failure Count: 0
- Permanent HW addr: 00:0c:29:3f:e8:a8
- Slave queue ID: 0