linux team方式進行網絡卡繫結
網絡卡繫結可採用team或者bond方式,模式如下:
|
使用team方式繫結網絡卡步驟如下:
1、建立team虛擬網絡卡,繫結網絡卡ens4f0,ens4f1,採用lacp方式
nmcli connection add type team con-name team0 ifname team0 config '{"runner":{"name":"lacp"}}' --建立team
nmcli connection modify team0 ipv4.addresses "172.24.6.110/24 172.24.6.110" --設定IP,掩碼,閘道器
nmcli connection modify team0 ipv4.method manual --手動
nmcli connection add type team-slave con-name team0-1 ifname ens4f0 master team0 --建立team-slave,指向ens4f0
nmcli connection add type team-slave con-name team0-2 ifname ens4f1 master team0 --建立team-slave,指向ens4f1
2、啟動team0
nmcli con up team0
3、檢視team0狀態ifconfig
teamdctl team0 state view
4、檢視驗證nmcli con show
若刪除網絡卡team0命令如下:
nmcli con delete team0
nmcli con delete team0-1
nmcli con delete team0-2
注意:lacp方式接入交換機側需要開啟LACP功能