步骤一:显示现有的网卡有哪些
# nmcli connection show
步骤二:添加网卡捆绑组
2.1 添加网卡捆绑组
2.1.1 添加网卡捆绑组的命令格式
# nmcli connection add type team con-name <connection name of network card binding group> ifname <name of network card binding group> config ‘{“runner”:{“name”:”activebackup”}}’
2.1.2 添加网卡捆绑组的案例
# nmcli connection add type team con-name team0 ifname team0 config ‘{“runner”:{“name”:”activebackup”}}’
2.2 添加网卡捆绑组的子网卡
2.2.1 添加网卡捆绑组子网卡的命令格式
# nmcli connection add type team-slave con-name <network card connection name> ifname <subnet card name> master <name of network card binding group>
2.2.2 添加网卡捆绑组子网卡的案例
# nmcli con add type team-slave con-name team0-port0 ifname eth0 master team0
# nmcli con add type team-slave con-name team0-port1 ifname eth1 master team0
步骤三:给网卡捆绑组配置 IP 地址
# nmcli connection modify team0 ipv4.addresses 192.168.100.5/24 ipv4.gateway 192.168.100.1 ipv4.method manual autoconnect yes
步骤四:启动网卡捆绑组
4.1 显示现有的网卡捆绑组和对应的子网卡有哪些
# nmcli connection show
4.2 启动网卡捆绑组里的子网卡
4.2.1 启动网卡捆绑组里子网卡的命令格式
# nmcli connection up <subnet card name>
4.2.2 启动网卡捆绑组里的子网卡
# nmcli connection up team0-port0
# nmcli connection up team0-port1
或者:
# nmcli connection reload
4.3 启动网卡捆绑组
4.3.1 启动网卡捆绑组的命令格式
# nmcli connection up <name of network card binding group>
4.3.2 启动网卡捆绑组的案例
# nmcli connection up team0
4.3.3 显示网卡捆绑组的状态
# teamdctl team1 status
步骤五:确认网卡捆绑组的 IP 地址配置成功
# ip address show
(补充:如果网卡组里出现了我们配置的 IP 地址,则代表 IP 地址配置成功)