nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name": "roundrobin"}}'
nmcli con modify team0 ipv4.address '192.168.8.10/24' ipv4.gateway '192.168.8.254' ipv4.dns '221.11.1.67'
nmcli con modify team0 ipv4.method manual
nmcli con add type team-slave ifname enp28s0f0 master team0
nmcli con add type team-slave ifname enp28s0f0 master team0
service network restart
teamdctl team0 statevim
nmcli connection up team-slave-em1
nmcli connection up team-slave-em2負載均衡
teamnl team0 portsrest
teamnl team0 optionsdns
下面正式開始使用命令來配置bondip
nmcli con add type bond ifname bond0 mode balance-rr #(balance-rr負載均衡)
nmcli con add type bond-slave ifname enp2s0f0 master bond0 (enp20f0網卡名字)
nmcli con add type bond-slave ifname enp2s0f1 master bond0(enp2sof1網卡名字)it
到此爲止bond0已經配置完成
[root@localhost network-scripts]# vim ifcfg-bond-bond0
[root@localhost network-scripts]# /etc/init.d/network restartio
DEVICE=em1
USERCTL=no
ONBOOT=yes
MASTER=bond0 # 須要和上面的ifcfg-bond0配置文件中的DEVICE的值對應 SLAVE=yes
BOOTPROTO=noneast
DEVICE=em2
USERCTL=no
ONBOOT=yes
MASTER=bond0 # 與 ifcfg-bond0 配置文件中的DEVICE的值對應 SLAVE=yes
BOOTPROTO=nonecli
[root@localhost ~]# cd /etc/sysconfig/network-scripts/配置
mkdir /tmp/wangka #在/tmp下面建立wangka的目錄用戶備份網卡配置文件
mv enp2s0f0 enp2s0f1 /tmp/wangka
將enp2s0f0 和 enp2s0f1 移除到 /tmp/wangka目錄中,由於使用命令作Bond的時候會從新生成配置文件
下面正式開始使用命令來配置bond
nmcli con add type bond ifname bond0 mode balance-rr #(balance-rr負載均衡)
nmcli con add type bond-slave ifname enp2s0f0 master bond0 (enp20f0網卡名字)
nmcli con add type bond-slave ifname enp2s0f1 master bond0(enp2sof1網卡名字)
到此爲止bond0已經配置完成
如今須要配置進入配置文件修改配置文件
[root@localhost network-scripts]# vim ifcfg-bond-bond0