Linux中配置网卡链路聚合

版权声明:转载请通知 https://blog.csdn.net/qq_41674452/article/details/84976482

优点:
高可用,负载均衡
实验环境:
Centos:
-------------ens32
-------------ens33


[root@localhost ~]# rm -rf /etc/sysconfig/network-scripts/ifcfg-ens*					#删除原有网卡配置文件
[root@localhost ~]# nmcli device status								#查看设备状态
[root@localhost ~]# systemctl restart network
[root@localhost ~]# nmcli connection add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}'		#创建链路聚合 
[root@localhost ~]# nmcli connection show							#查看网卡状态
[root@localhost ~]# nmcli connection add type team-slave con-name team0-1 ifname ens32 master team0
[root@localhost ~]# nmcli connection add type team-slave con-name team0-2 ifname ens33 master team0
[root@localhost ~]# nmcli device status
[root@localhost ~]# teamdctl team0 state							#查看team0链路状态
[root@localhost ~]# nmcli connection up team0-1						#开启team0-1
[root@localhost ~]# nmcli connection up team0-2						#开启team0-2
[root@localhost ~]# vim  /etc/sysconfig/network-scripts/ifcfg-team0
	###添加IP等网卡信息###
    ###或者用nmcli connection modify team0 ipv4.addresses 192.168.3.200/24 ipv4.gateway 192.168.3.254 ipv4.method manual
[root@localhost ~]# nmcli connection up team0							#开启team0
	######之后断开其中一块网卡模拟故障(vmwear虚拟机需要重启网卡)

猜你喜欢

转载自blog.csdn.net/qq_41674452/article/details/84976482