nmcli 网卡链路绑定team

来源:互联网 发布:微博域名修改 编辑:程序博客网 时间:2024/06/08 04:15

[root@server0 ~]# nmcli con show

创建一个名为team0并且属性为team的链路接口
[root@server0 ~]# nmcli con add type team con-name team0 ifname team0 config ‘{“runner”: {“name”:”activebackup”}}’

为team0配置ip地址与网关
[root@server0 ~]# nmcli connection modify team0 ipv4.addresses “192.168.25.211/24 192.168.25.250”

为team0配置DNS
[root@server0 ~]# nmcli connection modify team0 ipv4.dns “192.168.10.86 192.168.10.87”

设置team0的属性为 manual
[root@server0 ~]# nmcli connection modify team0 ipv4.method manual

将ent34网卡口 加到team0接口
[root@server0 ~]# nmcli connection add type team-slave conn-name team-port1 ifname ens34 master team0

将ent35网卡口 加到team0接口
[root@server0 ~]# nmcli connection add type team-slave conn-name team-port2 ifname ens35 master team0

启用接口中的网卡
[root@server0 ~]# nmcli connection up team-port1;nmcli connection up team-port2

[root@server0 ~]# teamdctl team0 state view
setup:
runner: activebackup
ports:
ens34
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
ens35
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
runner:
active port: ens34 //当前team0的主接口

转:http://blog.163.com/qiushuhui1989%40126/blog/static/2701108920152544352794/

原创粉丝点击