CentOS 7 链路聚合 


  将多个Linux网络端口绑定为一个,可以提升网络的性能,使用Linux teaming或bond来绑定多个网卡作为一个逻辑网口,配置单个的IP地址,会大幅提升服务器的网络吞吐(I/O),本是用team技术实现绑定多块网卡作为一个逻辑网口。下面就让我们开始新的学习之旅吧! 

                                   

1、首先准备两块网卡,它们有不同的MAC地址(先把这两块网卡用nmtui命令配置好)

 

centos服务器网卡做聚合 centos网卡聚合配置_运维


2、创建一个新连接,类型是team连接名称team0。

centos服务器网卡做聚合 centos网卡聚合配置_运维_02

 

3、master 配置好了,还得配置slave,即将eno16777736和eno33554960两块网卡加入到team0

centos服务器网卡做聚合 centos网卡聚合配置_重启_03


4、执行nmcli connection show命令查看team0-1和team0-2的状态

centos服务器网卡做聚合 centos网卡聚合配置_操作系统_04

 

5、执行nmcli connection up team0-1和nmcli connection up team0-2命令连接team0-1和team0-2

centos服务器网卡做聚合 centos网卡聚合配置_centos服务器网卡做聚合_05

 

6、执行ifconfig,发现网卡的地址都一样了,这样交换机才能转发包到同一个逻辑端口

centos服务器网卡做聚合 centos网卡聚合配置_centos服务器网卡做聚合_06

 

7、最后给team0 分配一个IP地址(也可以直接用图形工具设置IP地址)

centos服务器网卡做聚合 centos网卡聚合配置_IP_07

 

centos服务器网卡做聚合 centos网卡聚合配置_操作系统_08

 

8、测试一下,先看看team0当前状态

centos服务器网卡做聚合 centos网卡聚合配置_重启_09

 

注意:第二台主机的配置跟第一台主机前面的配置都一样,就是在配置IP地址时不一样。

centos服务器网卡做聚合 centos网卡聚合配置_centos服务器网卡做聚合_10

 

9、测试两台主机的连通性用ping命令,在VMware中做高可用(冗余)时需重启下系统。

centos服务器网卡做聚合 centos网卡聚合配置_重启_11

 

10、重启系统后,需用ifconfig命令查看下两块网卡的MAK地址;如果不一样,则用nmcli connection down team0、nmcli connection up team0,nmcli connection up team0-1、nmcli connection upteam0-2命令连接下team0-1和team0-2。

centos服务器网卡做聚合 centos网卡聚合配置_运维_12

 

用ping命令测试下连通性。

centos服务器网卡做聚合 centos网卡聚合配置_操作系统_13

 

11、做链路的负载均衡时,将activebackup改成loadbalance

centos服务器网卡做聚合 centos网卡聚合配置_重启_14

 

centos服务器网卡做聚合 centos网卡聚合配置_运维_15

 

12、重启下网卡,再用nmcli connection down team0、nmcli connection up team0,nmcli connection up team0-1、nmcli connection upteam0-2命令连接下team0-1和team0-2。

centos服务器网卡做聚合 centos网卡聚合配置_重启_16

 

centos服务器网卡做聚合 centos网卡聚合配置_操作系统_17

 

centos服务器网卡做聚合 centos网卡聚合配置_IP_18

 

注意:使用teamdctl team0 state查看下链路类型。

centos服务器网卡做聚合 centos网卡聚合配置_运维_19

 

    这个写完有几个月了,一直都没有发出来,如有觉得有问题的地方可以再下面评论留言,一起相互学习进步。


转载于:https://blog.51cto.com/12092502/1930774