mikuQ / miku

miku
GNU General Public License v3.0
2 stars 1 forks source link

nmcli-配置聚合口 #45

Open mikuQ opened 2 months ago

mikuQ commented 2 months ago

聚合步骤

@创建聚合口
nmcli connection add type bond con-name bond0 ifname bond0 bond.options "mode=active-backup"

@查看接口
nmcli device status
nmcli connection show

@添加成员口
nmcli connection add type ethernet slave-type bond con-name bond0-port1 ifname enp7s0 master bond0
nmcli connection add type ethernet slave-type bond con-name bond0-port2 ifname enp8s0 master bond0

@配置/静态IPv4地址/掩码/网关/DNS
nmcli connection modify bond0 ipv4.addresses '192.0.2.1/24' ipv4.gateway '192.0.2.254' ipv4.dns '192.0.2.253' ipv4.method manual

@配置/静态IPv6地址/掩码/网关/DNS
nmcli connection modify bond0 ipv6.addresses '2001:1::1/64' ipv6.gateway '2001:1::254' ipv6.dns '2001:1::fffd' ipv6.method manual

@配置自动启用成员端口
nmcli connection modify bond0 connection.autoconnect-slaves 1

@激活配置
nmcli connection up bond0

@显示聚合状态
cat /proc/net/bonding/bond0

聚合模式

*Active-backup 使用策略来确定在绑定中只有一个端口活跃。这个模式提供容错功能,不需要任何交换机配置。 bond模式