1.添加2块网卡做bond5聚合
不要在图形界面做,会出网卡自配IP,无法使用聚合


2.查询,配置虚拟网卡 ,根据自己的网关配置虚拟网关和dns,ip自定义

[root@guohui ~]# nmcli dev

[root@guohui ~]# nmcli connection add type bond mode balance-tlb con-name bond5 ifname bond5 ipv4.method manual ipv4.addresses 192.168.56.12/24 ipv4.gateway 192.168.56.2 ipv4.dns 192.168.56.2         

连接“bond5”(e6039f16-d78e-4fdd-82ca-b4490a40d9d3) 已成功添加。
[root@guohui ~]# nmcli dev
设备        类型      状态    连接   
bond5       bond      连接的  bond5  

3.将物理网卡连接至bond5

[root@guohui ~]# nmcli connection add type bond-slave con-name bond5-slave0 ifname ens38 master bond5
[root@guohui ~]# nmcli connection add type bond-slave con-name bond5-slave1 ifname ens39 master bond5
连接“bond5-slave0”(5e15186b-4fc9-450d-9095-bcbc553812ad) 已成功添加。

[root@guohui ~]# nmcli dev

4.查看bond信息

[root@guohui ~]# 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: ens38
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: ens38
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:ce:d7:d6
Slave queue ID: 0

[root@guohui ~]# ping 192.168.56.12
PING 192.168.56.12 (192.168.56.12) 56(84) bytes of data.
64 bytes from 192.168.56.12: icmp_seq=1 ttl=64 time=0.068 ms
64 bytes from 192.168.56.12: icmp_seq=2 ttl=64 time=0.031 ms
64 bytes from 192.168.56.12: icmp_seq=3 ttl=64 time=0.045 ms

断开

[root@guohui ~]# nmcli device disconnect ens38

[root@guohui~]# ping 192.168.56.12       当可ping通

激活

[root@guohi ~]# nmcli device connect ens38

成功用 'ens38' 激活了设备 '5e15186b-4fc9-450d-9095-bcbc553812ad'。