1. 程式人生 > >Linux中鏈路聚合之bond5類型聚合實例

Linux中鏈路聚合之bond5類型聚合實例

interface linux中 stat man balance 是否 loopback chan nfa

查看網卡狀態:

[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

Linux中鏈路聚合之bond5類型聚合實例