以H3C S12500系列以及S5100系列交换机为例,配置的步骤大致相同,只是个别命令的写法可能稍有区别。
需求举例:
两台H3C交换机配置IRF,交换机A的万兆接口Ti1/0/47、Ti1/0/48用于互联链路,Ti1/0/46用于BFD(分裂检测)链路。交换机B同样以47、48、46为例。
BFD(分裂检测)就是在IRF失效的时候会主动down掉一台交换机,防止出现双活的现象。
配置交换机SW-A
<Sysname> system-view
[Sysname] irf member 1Info: Member ID change will take effect after the switch reboots and operates in IRF mode.
[Sysname] irf priority 32[Sysname] interface range Ten-GigabitEthernet 1/0/47 to Ten-GigabitEthernet 1/0/48
[Sysname-Ten-GigabitEthernet] shutdown
[Sysname-Ten-GigabitEthernet] quit
[Sysname] irf-port 2[Sysname-irf-port 2] port group interface Ten-GigabitEthernet 1/0/47
[Sysname-irf-port 2] port group interface Ten-GigabitEthernet 1/0/48
[Sysname-irf-port 2] quit
[Sysname] interface range Ten-GigabitEthernet 1/0/47 to Ten-GigabitEthernet 1/0/48
[Sysname-Ten-GigabitEthernet] undo shutdown
[Sysname-Ten-GigabitEthernet] quit
[Sysname] save # 保存配置
[Y/N]:y
# 将设备的运行模式切换到 IRF 模式:
[Sysname] chassis convert mode irf
[Y/N]:y
Now rebooting, please wait... # 等待设备重启
重启后,交换机SW-A组成了只有一台成员设备的 IRF;
配置交换机SW-B
<Sysname> system-view
[Sysname] irf member 2Info: Member ID change will take effect after the switch reboots and operates in IRF mode.
[Sysname] irf priority 1
[Sysname] interface range Ten-GigabitEthernet 1/0/47 to Ten-GigabitEthernet 1/0/48
[Sysname-Ten-GigabitEthernet] shutdown
[Sysname-Ten-GigabitEthernet] quit
[Sysname] irf-port 1
[Sysname-irf-port 1] port group interface Ten-GigabitEthernet 1/0/47
[Sysname-irf-port 1] port group interface Ten-GigabitEthernet 1/0/48
[Sysname-irf-port 1] quit
[Sysname] interface range Ten-GigabitEthernet 1/0/47 to Ten-GigabitEthernet 1/0/48
[Sysname-Ten-GigabitEthernet] undo shutdown
[Sysname-Ten-GigabitEthernet] quit
[Sysname] save # 保存配置
[Y/N]:y
# 将设备的运行模式切换到 IRF 模式:
<Sysname> system-view
[Sysname] chassis convert mode irf
[Y/N]:y
Now rebooting, please wait... # 等待设备重启
设备 B 重启后与设备 A 形成 IRF;
配置 BFD MAD 检测
<Sysname> system-view
[Sysname] vlan 2021
[Sysname-vlan2021] description MAD_for_IRF
[Sysname-vlan2021] port Ten-GigabitEthernet 1/1/0/46 Ten-GigabitEthernet 2/1/0/46
[Sysname-vlan2021] quit
# 创建 VLAN 接口 2021,并配置 MAD IP 地址
[Sysname] interface vlan-interface 2021
[Sysname-Vlan-interface2021] mad bfd enable
[Sysname-Vlan-interface2021] mad ip address 10.50.50.1 30 member 1
[Sysname-Vlan-interface2021] mad ip address 10.50.50.2 30 member 2
[Sysname-Vlan-interface2021] quit
# 因为 BFD MAD 和生成树功能互斥,所以在检测链路 Ten-GigabitEthernet 1/1/0/46 和 Ten-GigabitEthernet 2/1/0/46 上关闭生成树协议。
[Sysname] interface Ten-GigabitEthernet 1/1/0/46[Sysname-Gigabitethernet1/1/0/46] undo stp enable
[Sysname-Gigabitethernet1/1/0/46] quit
[Sysname] interface Ten-GigabitEthernet 2/1/0/46
[Sysname-Gigabitethernet2/1/0/46] undo stp enable
[Sysname-Gigabitethernet2/1/0/46] quit
[Sysname] save # 保存配置
[Y/N]:y
这样两台交换机就完成堆叠以及检测链路的配置,逻辑上成为一台设备了;
通过 display irf link 可以查看irf接口的状态;
通过 display bfd session 可以查看检测链路(bfd)的状态;
需要注意的是,这时bfd的状态为“down”,是正常情况。因为当IRF状态失效(堆叠链路故障)时,bfd才会生效(Up)。
====================分割线====================
以S5100系列交换机为例
两台H3C交换机配置IRF,TG1/0/27和TG1/0/28用作互联,TG1/0/26用作BFD(分裂检测)。
配置交换机SW-A
system-view
irf member 1 priority 32
interface range Ten-GigabitEthernet 1/0/27 to Ten-GigabitEthernet 1/0/28
shutdown
quit
irf-port 1/2port group interface Ten-GigabitEthernet 1/0/27
port group interface Ten-GigabitEthernet 1/0/28
quit
interface range Ten-GigabitEthernet 1/0/27 to Ten-GigabitEthernet 1/0/28
undo shutdown
quit
irf-port-configuration active
save
y
将两个接口加入了IRF接口组,激活IRF。priority为优先级,值越大优先级越高。
配置交换机SW-B
system-view
irf member 1 renumber 2y
save
y
# 这一步是将备的这台设备的IRF成员号改为2,不一定需要配置。
# 如果是一台未配置过IRF的设备,可以不进行renumber并重启这一步。
# 需要重启
irf member 2 priority 1
interface range Ten-GigabitEthernet 2/0/27 to Ten-GigabitEthernet 2/0/28
shutdown
quit
irf-port 2/1
port group interface Ten-GigabitEthernet 2/0/27
port group interface Ten-GigabitEthernet 2/0/28
quit
interface range Ten-GigabitEthernet 2/0/27 to Ten-GigabitEthernet 2/0/28
undo shutdown
quit
save
irf-port-configuration active
save
y
配置两台设备之间的BFD(分裂检测)
system-view
sysname A+B # 写一个新的设备名(堆叠后,无论连接两台中的哪一台,设备名称和配置都是显示成一样的,即两台堆叠设备的配置是同步的)
vlan 2021 # 新建一个VLAN,用作BFD分裂检测
Name MAD
port GigabitEthernet1/0/26 GigabitEthernet2/0/26
quit
interface vlan-interface 2021
mad bfd enable
mad ip address 100.10.10.1 30 member 1 # 配置设备A的MAD点对点地址
mad ip address 100.10.10.2 30 member 2 # 配置设备B的MAD点对点地址,与设备A的通信
interface GigabitEthernet1/0/26
undo stp enable
interface GigabitEthernet2/0/26
undo stp enable
save
y
这样两台交换机就完成堆叠以及检测链路的配置,逻辑上成为一台设备了。