1. 创建bond网卡
nmcli connection add type bond con-name bond0 ifname bond0 mode balance-rr #轮询模式
2. 向bond0设备添加从属网卡
nmcli device status
nmcli connection add type ethernet slave-type bond con-name bond-slave-enp2s0f0 ifname enp2s0f0 master bond0
nmcli connection add type ethernet slave-type bond con-name bond-slave-enp2s0f1 ifname enp2s0f1 master bond0
3. 配置bond0设备的网络信息
nmcli connection modify bond0 ipv4.addresses 172.18.107.1/24
nmcli connection modify bond0 ipv4.gateway 172.18.107.254
nmcli connection modify bond0 ipv4.dns 8.8.8.8
nmcli connection modify bond0 ipv4.method manual
4. 启动和测试
nmcli connection up bond0
nmcli connection up bond-slave-enp2s0f0
nmcli connection up bond-slave-enp2s0f1
ping -c 4 172.18.107.254
ping -c 4 8.8.8.8