003-两台交换机堆叠(IRF)

两台交换机堆叠(IRF)

概念

IRF (Intelligent Resilient Framework) 是华为公司提出的一种交换机堆叠技术,它允许用户将多台物理交换机设备连接在一起,从而逻辑上形成一个单一的、统一的、大容量的虚拟交换机。IRF堆叠技术通过堆叠线缆将交换机连接成一个整体,使得这些交换机在逻辑上成为一个独立的设备,共享相同的配置、转发表、接口和MAC地址表等,为用户提供更高的可靠性、灵活性和可扩展性。

IRF堆叠的主要特点包括:

  1. 高可靠性:IRF堆叠采用冗余备份、负载均衡等技术,提高了系统的可靠性和可用性。当堆叠中的某台交换机出现故障时,其他交换机可以自动接管其业务,保证业务的连续性和可用性。

  2. 简化管理:IRF堆叠将多台交换机逻辑上视为一台设备,因此用户只需要对堆叠系统进行一次配置和管理,大大简化了网络管理的复杂性。

  3. 灵活扩展:IRF堆叠支持在线扩容,用户可以在不影响业务运行的情况下,通过增加堆叠成员来扩展交换机的带宽、端口数量和处理能力。

  4. 统一转发:IRF堆叠中的交换机共享相同的转发表,实现了跨设备的快速转发,提高了网络的转发效率和性能。

  5. 增强安全性:IRF堆叠支持多种安全特性,如访问控制列表(ACL)、端口安全、MAC地址绑定等,可以保护网络免受非法访问和攻击。

在配置IRF堆叠时,需要注意以下几点:

  1. 堆叠线缆:堆叠线缆是连接IRF堆叠中交换机的关键组件,需要选择正确的堆叠线缆类型并正确连接。

  2. 堆叠ID和优先级:每个IRF堆叠系统都需要一个唯一的堆叠ID,并且每个堆叠成员都需要配置一个优先级值。优先级最高的交换机将成为堆叠的主交换机。

  3. 配置同步:在IRF堆叠中,配置是自动同步的。因此,在配置堆叠时,只需要对主交换机进行配置,其他交换机将自动同步这些配置。

  4. 堆叠分裂:在某些情况下,IRF堆叠可能会发生分裂,即堆叠成员之间的连接断开。为了避免这种情况,需要合理配置堆叠的冗余备份和负载均衡等特性。

总之,IRF堆叠技术为用户提供了一种高效、可靠、灵活的网络解决方案,可以满足各种复杂网络环境的需求。

华三实验拓扑图

image-20240607223319125

实验目的

将两台华三交换机堆叠成一台交换机

注意事项

1、做堆叠前先关闭堆叠口
2、要关闭端口隔离在堆叠

若没有关闭端口隔离,会出现以下报错

Failed to bind the physical interface to the IRF port, because port isolation is enabled on the device.

该错误消息表明在尝试将物理接口绑定到IRF(Intelligent Resilient Framework,智能弹性架构)端口时失败了,原因是设备上的端口隔离功能已启用。IRF是华为等网络设备制造商提供的一种技术,它允许将多个物理设备虚拟化为一个逻辑设备,以提供更高的可靠性和可扩展性。

要解决这个问题,请按照以下步骤操作:

  1. 登录设备:首先,使用适当的命令行接口(CLI)或网络管理工具登录到网络设备。

  2. 检查端口隔离设置:查看端口隔离的配置,以确定哪些端口被隔离以及是否有可能影响IRF绑定的设置。

    例如,在华为设备上,您可以使用如下命令来检查端口隔离配置:

    display port-isolate group
    
  3. 禁用端口隔离:如果端口隔离设置影响到了IRF端口的绑定,您可能需要暂时或永久地禁用端口隔离。

    在华为设备上,您可以使用以下命令来禁用端口隔离(具体命令取决于您的设备和配置):

    undo port-isolate enable [interface-type interface-number]
    

    或者,如果您要禁用整个隔离组,可以使用:

    undo port-isolate group group-id
    
3、做完堆叠后使用dis irf查看是否堆叠成功

image-20240607225322264

4、堆叠完成后根据需求划分vlan

例如将1/0/1到1/0/48口划分到vlan30下(今天我做两台华三的设备堆叠时,由于第二台交换机没有划分vlan,导致第二台交换机的任意一个口都ping不通两台堆叠交换机的上联、网关)

[SW1]vlan 30
[SW1-vlan30]quit
[SW1]interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/48
[SW1-if-range]port link-type access #在access模式下,接口只属于一个VLAN,并且只转发属于该VLAN的数据帧。
[SW1-if-range]
[SW1-if-range]port access vlan 30
[SW1-if-range]
[SW1-if-range]quit
5、IRF角色选举

5.1IRF角色选举规则

确定成员设备角色为主设备或从设备的过程称为角色选举。角色选举会在以下情况下进行:IRF 建立、主设备离开或者故障、两个 IRF 合并等。
角色选举规则如下:

  1. 当前主设备优先,IRF 不会因为有新的成员设备加入而重新选举主设备。不过,当 IRF形成时,因为没有主设备,所有加入的设备都认为自己是主设备,则继续下一条规则的比较。
  2. 成员优先级大的优先。如果优先级相同,则继续下一条规则的比较。
  3. 系统运行时间长的优先。在 IRF 中,成员设备启动时间间隔精度为 10 分钟,即 10分钟之内启动的设备,则认为它们是同时启动的,则继续下一条规则的比较。
  4. CPU MAC 小的优先。通过以上规则选出的最优成员设备即为主设备,其它成员设备则均为从设备。

5.2更改优先级改变master

默认优先级为1,更改后并不会重新选举,需要member 1重启(谨慎)

[SW1]irf member 2 priority 10
  • irf member 2:这指定了堆叠中的成员2(即第二个交换机)。IRF堆叠中的每个交换机都有一个唯一的成员编号,从1开始。
  • priority 10:这设置了成员2的优先级为10。在IRF堆叠中,优先级决定了哪个交换机将成为堆叠的主交换机(Master)。数值越大,优先级越高,优先级最高的交换机将成为主交换机,负责整个堆叠的配置和管理。

实验步骤

  1. 创建两台S6850华三交换机,连接两个光口
  2. 进入交换机进行配置,配置命令如下
Automatic configuration is running, press CTRL_C or CTRL_D to break.
Automatic configuration is aborted.
Line con0 is available.


Press ENTER to get started.
******************************************************************************
* Copyright (c) 2004-2022 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent,                                 *
* no decompiling or reverse-engineering shall be allowed.                    *
******************************************************************************

<H3C>%Jun  7 22:16:13:660 2024 H3C SHELL/5/SHELL_LOGIN: Console logged in from con0.

<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysname SW2
[SW2]
[SW2]interface Ten-GigabitEthernet1/0/52 #进入堆叠口,将其关闭
[SW2-Ten-GigabitEthernet1/0/52]shutdown
[SW2-Ten-GigabitEthernet1/0/52]
[SW2-Ten-GigabitEthernet1/0/52]quit
[SW2]
[SW2]%Jun  7 22:22:08:627 2024 SW2 LLDP/5/LLDP_NEIGHBOR_AGE_OUT: Nearest bridge agent neighbor aged out on port FortyGigE1/0/53 (IfIndex 54), neighbor's chassis ID is 2c92-2e68-0100, port ID is FortyGigE1/0/53.
[SW2]
[SW2]irf domain 10 #设置IRF域编号
[SW2]
[SW2]irf member 1 renumber 2 #设置member的成员编号为2 因为这里是配置的第二台交换机
Renumbering the member ID may result in configuration change or loss. Continue?[Y/N]:y
Please reboot the device for the new member ID to take effect.
[SW2]
[SW2]irf-port 1/2 #进入IRF端口
[SW2-irf-port1/2]port group interface Ten-GigabitEthernet 1/0/52 #绑定堆叠物理口
You must perform the following tasks for a successful IRF setup: 
Save the configuration after completing IRF configuration. 
Execute the "irf-port-configuration active" command to activate the IRF ports. 
[SW2-irf-port1/2]
[SW2-irf-port1/2]quit
[SW2]
[SW2]interface Ten-GigabitEthernet1/0/52 #进入堆叠口,将其打开
[SW2-Ten-GigabitEthernet1/0/52]undo shutdown
[SW2-Ten-GigabitEthernet1/0/52]%Jun  7 22:27:36:340 2024 SW2 IFNET/3/PHY_UPDOWN: Physical state on the interface Ten-GigabitEthernet1/0/52 changed to up.
%Jun  7 22:27:36:340 2024 SW2 IFNET/5/LINK_UPDOWN: Line protocol state on the interface Ten-GigabitEthernet1/0/52 changed to up.
%Jun  7 22:27:36:340 2024 SW2 LLDP/6/LLDP_CREATE_NEIGHBOR: Nearest bridge agent neighbor created on port Ten-GigabitEthernet1/0/52 (IfIndex 53), neighbor's chassis ID is 2c92-2e68-0100, port ID is Ten-GigabitEthernet1/0/52.
[SW2-Ten-GigabitEthernet1/0/52]
[SW2-Ten-GigabitEthernet1/0/52]quit
[SW2]irf-port-configuration active #激活IRF端口下的配置
[SW2]%Jun  7 22:27:56:170 2024 SW2 STM/6/STM_LINK_UP: IRF port 2 came up.
 ID conflict occur. The ID of 1 has been used for 2 times!

[SW2]save #保存!!!
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
Validating file. Please wait...
Saved the current configuration to mainboard device successfully.
[SW2]
[SW2]quit
<SW2>reboot #重启
Start to check configuration with next startup configuration file, please wait.........DONE!
This command will reboot the device. Continue? [Y/N]:y
Now rebooting, please wait....%Jun  7 22:29:14:011 2024 SW2 DEV/5/SYSTEM_REBOOT: System is rebooting now.
..Cryptographic algorithms tests passed.



Line con1 is available.

重启后进入第二台交换机,显示的是SW1,因为此时的两台交换机的堆叠已经配置好了,显示进入的是第一台交换机,可以通过dis irf命令查看堆叠的信息


Press ENTER to get started.
******************************************************************************
* Copyright (c) 2004-2022 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent,                                 *
* no decompiling or reverse-engineering shall be allowed.                    *
******************************************************************************

<SW1>%Jun  7 22:30:26:921 2024 SW1 SHELL/5/SHELL_LOGIN: Console logged in from con1.
%Jun  7 22:30:26:922 2024 SW1 HA/5/HA_BATCHBACKUP_FINISHED: Batch backup of standby board in slot 2 has finished.

<SW1>
<SW1>sys
System View: return to User View with Ctrl+Z.
[SW1]
[SW1]dis irf
MemberID    Role    Priority  CPU-Mac         Description
  *1        Master  1         2c92-2e68-0104  ---
  +2        Standby 1         2c92-340d-0204  ---
--------------------------------------------------
 * indicates the device is the master.
 + indicates the device through which the user logs in.

 The bridge MAC of the IRF is: 2c92-2e68-0100
 Auto upgrade                : yes
 Mac persistent              : 6 min
 Domain ID                   : 10
[SW1]

注意:上面只展示了一台交换机的配置,两台交换机做同样的配置,注意:两台设备的成员编号不一样

做完堆叠后同时扫描一下端口状态display interface brief ,应该能扫描到两个交换机的全部端口状态

[SW1]display interface brief 
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface            Link Protocol Primary IP        Description              
InLoop0              UP   UP(s)    --                
MGE0/0/0             DOWN DOWN     --                
NULL0                UP   UP(s)    --                
REG0                 UP   --       --                

Brief information on interfaces in bridge mode:
Link: ADM - administratively down; Stby - standby
Speed: (a) - auto
Duplex: (a)/A - auto; H - half; F - full
Type: A - access; T - trunk; H - hybrid
Interface            Link Speed     Duplex Type PVID Description              
FGE1/0/53            DOWN 40G       A      A    1    
FGE1/0/54            DOWN 40G       A      A    1    
FGE2/0/53            DOWN 40G       A      A    1    
FGE2/0/54            DOWN 40G       A      A    1    
GE1/0/1              DOWN auto      A      A    30   
GE1/0/2              DOWN auto      A      A    30   
GE1/0/3              DOWN auto      A      A    30   
GE1/0/4              DOWN auto      A      A    30   
GE1/0/5              DOWN auto      A      A    30   
GE1/0/6              DOWN auto      A      A    30   
GE1/0/7              DOWN auto      A      A    30   
GE1/0/8              DOWN auto      A      A    30   
GE1/0/9              DOWN auto      A      A    30   
GE1/0/10             DOWN auto      A      A    30   
GE1/0/11             DOWN auto      A      A    30   
GE1/0/12             DOWN auto      A      A    30   
GE1/0/13             DOWN auto      A      A    30   
GE1/0/14             DOWN auto      A      A    30   
GE1/0/15             DOWN auto      A      A    30   
GE1/0/16             DOWN auto      A      A    30   
GE1/0/17             DOWN auto      A      A    30   
GE1/0/18             DOWN auto      A      A    30   
GE1/0/19             DOWN auto      A      A    30   
GE1/0/20             DOWN auto      A      A    30   
GE1/0/21             DOWN auto      A      A    30   
GE1/0/22             DOWN auto      A      A    30   
GE1/0/23             DOWN auto      A      A    30   
GE1/0/24             DOWN auto      A      A    30   
GE1/0/25             DOWN auto      A      A    30   
GE1/0/26             DOWN auto      A      A    30   
GE1/0/27             DOWN auto      A      A    30   
GE1/0/28             DOWN auto      A      A    30   
GE1/0/29             DOWN auto      A      A    30   
GE1/0/30             DOWN auto      A      A    30   
GE1/0/31             DOWN auto      A      A    30   
GE1/0/32             DOWN auto      A      A    30   
GE1/0/33             DOWN auto      A      A    30   
GE1/0/34             DOWN auto      A      A    30   
GE1/0/35             DOWN auto      A      A    30   
GE1/0/36             DOWN auto      A      A    30   
GE1/0/37             DOWN auto      A      A    30   
GE1/0/38             DOWN auto      A      A    30   
GE1/0/39             DOWN auto      A      A    30   
GE1/0/40             DOWN auto      A      A    30   
GE1/0/41             DOWN auto      A      A    30   
GE1/0/42             DOWN auto      A      A    30   
GE1/0/43             DOWN auto      A      A    30   
GE1/0/44             DOWN auto      A      A    30   
GE1/0/45             DOWN auto      A      A    30   
GE1/0/46             DOWN auto      A      A    30   
GE1/0/47             DOWN auto      A      A    30   
GE1/0/48             DOWN auto      A      A    30   
GE2/0/1              DOWN auto      A      A    1    
GE2/0/2              DOWN auto      A      A    1    
GE2/0/3              DOWN auto      A      A    1    
GE2/0/4              DOWN auto      A      A    1    
GE2/0/5              DOWN auto      A      A    1    
GE2/0/6              DOWN auto      A      A    1    
GE2/0/7              DOWN auto      A      A    1    
GE2/0/8              DOWN auto      A      A    1    
GE2/0/9              DOWN auto      A      A    1    
GE2/0/10             DOWN auto      A      A    1    
GE2/0/11             DOWN auto      A      A    1    
GE2/0/12             DOWN auto      A      A    1    
GE2/0/13             DOWN auto      A      A    1    
GE2/0/14             DOWN auto      A      A    1    
GE2/0/15             DOWN auto      A      A    1    
GE2/0/16             DOWN auto      A      A    1    
GE2/0/17             DOWN auto      A      A    1    
GE2/0/18             DOWN auto      A      A    1    
GE2/0/19             DOWN auto      A      A    1    
GE2/0/20             DOWN auto      A      A    1    
GE2/0/21             DOWN auto      A      A    1    
GE2/0/22             DOWN auto      A      A    1    
GE2/0/23             DOWN auto      A      A    1    
GE2/0/24             DOWN auto      A      A    1    
GE2/0/25             DOWN auto      A      A    1    
GE2/0/26             DOWN auto      A      A    1    
GE2/0/27             DOWN auto      A      A    1    
GE2/0/28             DOWN auto      A      A    1    
GE2/0/29             DOWN auto      A      A    1    
GE2/0/30             DOWN auto      A      A    1    
GE2/0/31             DOWN auto      A      A    1    
GE2/0/32             DOWN auto      A      A    1    
GE2/0/33             DOWN auto      A      A    1    
GE2/0/34             DOWN auto      A      A    1    
GE2/0/35             DOWN auto      A      A    1    
GE2/0/36             DOWN auto      A      A    1    
GE2/0/37             DOWN auto      A      A    1    
GE2/0/38             DOWN auto      A      A    1    
GE2/0/39             DOWN auto      A      A    1    
GE2/0/40             DOWN auto      A      A    1    
GE2/0/41             DOWN auto      A      A    1    
GE2/0/42             DOWN auto      A      A    1    
GE2/0/43             DOWN auto      A      A    1    
GE2/0/44             DOWN auto      A      A    1    
GE2/0/45             DOWN auto      A      A    1    
GE2/0/46             DOWN auto      A      A    1    
GE2/0/47             DOWN auto      A      A    1    
GE2/0/48             DOWN auto      A      A    1    
XGE1/0/49            DOWN 10G       F      A    1    
XGE1/0/50            DOWN 10G       F      A    1    
XGE1/0/51            DOWN 10G       F      A    1    
XGE1/0/52            UP   10G       F      --   --   
XGE2/0/49            DOWN 10G       F      A    1    
XGE2/0/50            DOWN 10G       F      A    1    
XGE2/0/51            DOWN 10G       F      A    1    
XGE2/0/52            UP   10G       F      --   --   

[SW1] 

参考文章:http://t.csdnimg.cn/Sj7Nn

相关推荐

  1. istack智能

    2024-06-10 07:24:03       28 阅读
  2. 流量控制+MSTP++VRRP+BFD

    2024-06-10 07:24:03       55 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-10 07:24:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-10 07:24:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-06-10 07:24:03       82 阅读
  4. Python语言-面向对象

    2024-06-10 07:24:03       91 阅读

热门阅读

  1. 正态分布公式

    2024-06-10 07:24:03       33 阅读
  2. 使用 AES 算法在 C# 中实现安全字符串加密和解密

    2024-06-10 07:24:03       28 阅读
  3. 使用Spring Cloud设计电商系统架构

    2024-06-10 07:24:03       31 阅读
  4. Spring RestClient报错:400 Bad Request : [no body]

    2024-06-10 07:24:03       31 阅读
  5. 临近空间飞艇技术

    2024-06-10 07:24:03       36 阅读
  6. IO流(字符流)

    2024-06-10 07:24:03       32 阅读