交换机的链路聚合和配置过程

链路聚合个人理解思维:

  将几个接口虚拟为一个接口,这也注定每个接口都要一模一样。

链路聚合的模式:

 

手工负载模式: 所有活活动接口都参与数据的转发,分担负载流量
LACP模式:如上图,有三条线路,其中有俩进行转发数据,其中一条是不进行转发数数据,作为备份,其他线路有问题后第三条进行转发数据, 如果你用了LACP模式,他会产生LACP报文类似BPDU报文,去维护端口的状态。

链路聚合(eth-trunk)
一组链路“捆绑”
作用:1.增加带宽 2.更多的冗余链路 3.提高链路的利用率,STP中被看做一个链路 4.支持负载分
担(把数据放到不同的物理链路)
条件:实施eth-trunk必须是混杂模式 

           每个接口配置要一模一样

(Eth-Trunk链路两端相连的物理接口的数量,速率,双工方式,流控制,端口的模式都要一样, 说白了就是如果你想做聚合链路,对应的端口配置都是相同的,比如链路类型,划分的Vlan等。)

所以应先清除接口配置(清除后为默认,接口为关闭状态)

     清除后应开启接口

清除命令:

clear configuration int g0/0/1

两种视图下都应使用这个命令

方法一:

[Huawei-GigabitEthernet0/0/2]clear configuration int g0/0/1
Warning: All configurations of the interface will be cleared, and its state will
 be shutdown. Continue? [Y/N] :y
Info: Total execute 1 command(s), 1 successful, 0 failed.

方法二: 用户视图

[Huawei]clear configuration int g0/0/1
Warning: All configurations of the interface will be cleared, and its state will
 be shutdown. Continue? [Y/N] :y
Info: Total execute 1 command(s), 1 successful, 0 failed.
 

 

 聚合实操:

 switch1:

[s1]clear configuration interface GigabitEthernet 0/0/1

[s1-GigabitEthernet0/0/1]undo shutdown

[s1]clear configuration interface GigabitEthernet 0/0/2

[s1-GigabitEthernet0/0/2]undo shutdown

[s1]interface Eth-Trunk 10   #创建一个聚合链路id为10 可将多个接口视为一个接口
[s1-Eth-Trunk10]trunkport GigabitEthernet 0/0/1 to 0/0/2 #将G0/0/1和G0/0/2加入这个聚合链路里

[s1-Eth-Trunk10]]port  link-type  trunk #修改链路类型

[s1-Eth-Trunk10]port trunk pvid vlan 110 #这个vlan应先创建好。

[s1-Eth-Trunk10]port trunk allow-pass vlan all #允许所有vlan通过

 switch2:

[s2]clear configuration interface GigabitEthernet 0/0/1

[s2-GigabitEthernet0/0/1]undo shutdown

[s2]clear configuration interface GigabitEthernet 0/0/2

[s2-GigabitEthernet0/0/2]undo shutdown

[s2]interface Eth-Trunk 10   #创建一个聚合链路id为10 交换机两端这个聚合链路id最好一致
[s2-Eth-Trunk10]trunkport GigabitEthernet 0/0/1 to 0/0/2 #将G0/0/1和G0/0/2加入这个聚合链路里

[s2-Eth-Trunk10]]port  link-type  trunk #修改链路类型

[s2-Eth-Trunk10]port trunk pvid vlan 110 #这个vlan应先创建好。

[s2-Eth-Trunk10]port trunk allow-pass vlan all #允许所有vlan通过

 查看配置:

[s1]dis eth-trunk 10
Eth-Trunk10's state information is:
WorkingMode: NORMAL         Hash arithmetic: According to SIP-XOR-DIP         
Least Active-linknumber: 1  Max Bandwidth-affected-linknumber: 8              
Operate status: down        Number Of Up Port In Trunk: 2                     
--------------------------------------------------------------------------------
PortName                      Status      Weight 
GigabitEthernet0/0/1          Down        1      
GigabitEthernet0/0/2          Down        1     

 WorkingMode: NORMAL     NORMAL  为手工负责模式

Least Active-linknumber: 1     最少活动接口 1个

Operate status: down   链路是否运行

Hash arithmetic: According to SIP-XOR-DIP 一种算法

Max Bandwidth-affected-linknumber: 8    8代表做大带宽数

 Number Of Up Port In Trunk: 2  聚合链路eth-trunk中有两条链路工作

三层的链路聚合:

重要:[s1-Eth-Trunk10]undo portswitch #改为三层链路聚合 其他和二层一样

[s1]clear configuration interface GigabitEthernet 0/0/1

[s1-GigabitEthernet0/0/1]undo shutdown

[s1]clear configuration interface GigabitEthernet 0/0/2

[s1-GigabitEthernet0/0/2]undo shutdown

[s1]interface Eth-Trunk 10   #创建一个聚合链路id为10 可将多个接口视为一个接口

[s1-Eth-Trunk10]undo portswitch #改为三层链路聚合
[s1-Eth-Trunk10]trunkport GigabitEthernet 0/0/1 to 0/0/2 #将G0/0/1和G0/0/2加入这个聚合链路里

[s1-Eth-Trunk10]]port  link-type  trunk #修改链路类型

[s1-Eth-Trunk10]port trunk pvid vlan 110 #这个vlan应先创建好。

[s1-Eth-Trunk10]port trunk allow-pass vlan all #允许所有vlan通过

 

 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Linux多网卡绑定与交换机链路聚合是一种将多个物理网卡绑定为一个逻辑接口的技术,在高负载环境下提高网络带宽和可靠性。以下是关于如何配置Linux多网卡绑定和交换机链路聚合的指导: 1. Linux多网卡绑定配置: a. 确保服务器上安装了所需的驱动程序和工具,如bonding模块和ifenslave b. 在/etc/modules文件中添加bonding模块:modprobe bonding c. 创建一个新的网络接口,如bond0:编辑/etc/network/interfaces文件,并添加以下行: auto bond0 iface bond0 inet static address 192.168.xxx.xxx netmask 255.255.255.0 gateway 192.168.xxx.xxx slaves eth0 eth1 bond-mode 4 bond-miimon 100 bond-downdelay 200 bond-updelay 200 bond-lacp-rate 1 bond-xmit-hash-policy layer2+3 bond-primary eth0 d. 保存文件并重启网络服务:service networking restart 2. 交换机链路聚合配置: a. 登录交换机的管理界面 b. 创建一个新的聚合组:选择一个可用的组号,并指定组的工作模式为链路聚合(LACP或者Static) c. 添加相应的物理接口到聚合组中:将服务器上用于多网卡绑定的物理接口添加到交换机的聚合组中 d. 配置组的其他参数:根据需求,可以配置链路聚合组的一些其他参数,如备用接口、链路优先级等 e. 保存并应用配置,确保交换机和服务器的配置一致 配置完成后,多个物理网卡将作为一个逻辑接口(bond0)运行,向外提供网络连接。交换机链路聚合将这些物理链路合并成一个逻辑链路,提供更高的带宽和可靠性。需要注意的是,配置过程中需要确保服务器和交换机配置参数一致,否则可能会导致链路无法正常工作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值