您的位置:首页 > 理论基础 > 计算机网络

Linux系统上利用nmcli命令创建网络组

2016-09-06 10:42 423 查看
网络组:是将多个网卡聚合在一起方法,从而实现冗错和提高吞吐量
网络组不同于旧版中bonding技术,提供更好的性能和扩展性
网络组由内核驱动和teamd守护进程实现.

下面我们以CentOS7系统为环境,演示下如何在Linux系统上利用nmcli命令创建网络组
nmcli connection add con-name team0 type team ifname team0 config '{"runner":{"name":"activebackup"}}'
创建ifcfg-team0配置文件



nmcli connection modify team0 ipv4.addresses 10.1.56.56/16
为team0添加IP



修改ifcfg-team0配置文件中的BOOTPROTO=none



nmcli connection add con-name team-port1 type team-slave ifname eno33554984 master team0
nmcli connection add con-name team-port2 type team-slave ifname eno50332208 master team0
创建port1和prot2接口



查看port1和port2配置文件



nmcli connection up team0 启用team0并查看




nmcli connection up team-port1 启用port1接口
nmcli connection up team-port2 启用port2接口
并查看



teamdctl team0 state 查看team0的详细信息和启用网卡情况
发现port1的eno33554984处于runner状态



ifconfig查看网卡,发现eno33554984和eno50332208没有IP地址
而team0拥有IP地址,这说明我们的配置是正确的,eno33554984和eno50332208服务于team0



模拟损坏port1,发现在丢失一定数量的数据包后网络恢复正常



teamdctl team0 state 查看team0的详细信息和启用网卡情况
发现之前的port1已经处于down状态,port2的eno50332208处于runner状态



模拟port1和port2全部损坏



在丢失一定数量的数据包后网络再次恢复正常




这是因为在我们之前的IP配置时,默认设置的为global全局可用,所以当team0网络组的两的接口全部损坏时,系统的另一个网卡eno16777736自动接手网络工作,从而就实现了冗错机制。


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息