方法一、通过nmcli
nmcli con add type bond con-name bond0 ifname bond0 mode active-backup
nmcli connection modify bond0 ipv4.method manual ipv4.addresses 10.10.10.10/24 ipv4.gateway 10.10.10.1 ipv4.dns 8.8.8.8 ipv6.method ignore
bond模式:
mod=0 (balance-rr)Round-robin policy (平衡抢循环策略)
mod=1 (active-backup)Active-backup policy (主-备份策略)
mod=2 (balance-xor)XOR policy (平衡策略)
mod=3 (broadcast) (广播策略)
mod=4 (802.3ad)IEEE 802.3ad Dynamic link aggregation (IEEE802.3ad 动态链接聚合)
mod=5 (balance-tlb)Adaptive transmit load balancing (适配器传输负载均衡)
mod=6 (balance-alb)Adaptive load balancing (适配器适应性负载均衡)
添加真实网口 (例如ens7和ens3)到bond0
nmcli con add type bond-slave ifname ens7 master bond0
nmcli con add type bond-slave ifname ens3 master bond0
激活网口
nmcli con up bond-slave-ens7
nmcli con up bond-slave-ens3
nmcli con up bond0
方法二、通过nmtui
方法三、通过图形界面