Linux中链路聚合之bond5类型聚合实例

查看网卡状态:

[root@linfan ~]# nmcli device
DEVICE  TYPE      STATE      CONNECTION         
eth0    ethernet  connected  eth0               
eth1    ethernet  connected  Wired connection 1 
eth2    ethernet  connected  Wired connection 2 
lo      loopback  unmanaged  --                 

创建bond5.模式为balance-tlb

[root@linfan ~]# nmcli connection add type bond \
> mode balance-tlb con-name bond5 ifname bond5 \
> ipv4.method manual \
> ipv4.addresses 192.168.24.250/24 \
> ipv4.gateway 192.168.24.1 \
> ipv4.dns 8.8.8.8
Connection 'bond5' (933aff7a-9501-45fb-ab15-3039840e273e) successfully added.

添加物理网卡链接到bond5

[root@linfan ~]# nmcli connection add type bond-slave con-name bond-slave1 ifname eth1 master bond5
Connection 'bond-slave1' (99d54040-948c-4a32-8934-527962c0fa72) successfully added.
[root@linfan ~]# nmcli connection add type bond-slave con-name bond-slave2 ifname eth2 master bond5
Connection 'bond-slave2' (ad2bf7c6-e4fc-4268-aaa0-fc96e5c7525f) successfully added.

查看bond配置信息

[root@linfan ~]# cat /proc/net/bonding/bond5
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: transmit load balancing
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:2e:e0:a9
Slave queue ID: 0

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:2e:e0:b3
Slave queue ID: 0

关闭eth1网卡 测试bond5是否正常

[root@linfan ~]# nmcli device disconnect eth1
Device 'eth2' successfully disconnected.
[root@linfan ~]# cat /proc/net/bonding/bond5
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: transmit load balancing
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:2e:e0:a9
Slave queue ID: 0

猜你喜欢

转载自blog.51cto.com/13858192/2145141