IRF组网拓扑图
IRF组网地址规划
IRF组网目标
HX_1和HX_2组成IRF设备,其中HX_1为主设备;
R_1和R_2组成IRF设备,其中R_1为主设备;
HX、FenZhi01和FenZhi02设备之间的业务地址段实现相互通信;
HX设备配置
HX_1设备IRF配置
system-view
[H3C]sysname HX_1
#把HX_1设备IRF优先级设置为30
[HX_1]irf member 1 priority 30
#把HX_1设备Ten-GigabitEthernet1/0/49接口shutdown以便加入IRF接口
[HX_1]interface Ten-GigabitEthernet1/0/49
[HX_1-Ten-GigabitEthernet1/0/49]shutdown
[HX_1-Ten-GigabitEthernet1/0/49]quit
[HX_1]
#创建irf-port 1/2接口并把Ten-GigabitEthernet1/0/49接口加入该接口
[HX_1]irf-port 1/2
[HX_1-irf-port1/2]port group interface Ten-GigabitEthernet 1/0/49
[HX_1-irf-port1/2]quit
[HX_1]interface Ten-GigabitEthernet1/0/49
[HX_1-Ten-GigabitEthernet1/0/49]undo shutdown
[HX_1-Ten-GigabitEthernet1/0/49]quit
#激活IRF配置
[HX_1]irf-port-configuration active
[HX_1]sa force
[HX_1]
system-view
HX_2设备IRF配置
[H3C]sysname HX_2
#修改HX_2的IRF编号、保存配置并重启
#默认情况下,该设备的IRF优先级设置为1
[HX_2]irf member 1 renumber 2
Renumbering the member ID may result in configuration change or loss. Continue?[Y/N]:y
[HX_2]save force
[HX_2]quit
reboot
#
[HX_2]interface Ten-GigabitEthernet2/0/49
[HX_2-Ten-GigabitEthernet2/0/49]shutdown
[HX_2-Ten-GigabitEthernet2/0/49]quit
[HX_2]
[HX_2]irf-port 2/1
[HX_2-irf-port2/1]port group interface Ten-GigabitEthernet 2/0/49
[HX_2-irf-port2/1]quit
[HX_2]interface Ten-GigabitEthernet2/0/49
[HX_2-Ten-GigabitEthernet2/0/49]undo shutdown
[HX_2-Ten-GigabitEthernet2/0/49]quit
[HX_2]
#务必先保存配置再激活IRF配置
[HX_2]save force
[HX_2]
#激活IRF配置,HX_2设备自动重启并同步HX_1主设备的配置文件
#设备重新启动后,两台设备组成IRF设备
[HX_2]irf-port-configuration active
[HX_2]%Feb 16 15:17:53:564 2023 HX_2 STM/6/STM_LINK_UP: IRF port 1 came up.
HX设备IRF MAD BFD检测配置
#对HX_1和HX_2组成IRF设备进行重命名为HX
[HX_1]sysname HX
[HX]vlan 1000
[HX-vlan1000]quit
[HX]
[HX]interface Bridge-Aggregation 1
[HX-Bridge-Aggregation1]description MAD BFD
[HX-Bridge-Aggregation1]quit
[HX]
[HX]interface GigabitEthernet 1/0/48
[HX-GigabitEthernet1/0/48]port link-aggregation group 1
[HX-GigabitEthernet1/0/48]quit
[HX]interface GigabitEthernet 2/0/48
[HX-GigabitEthernet2/0/48]port link-aggregation group 1
[HX-GigabitEthernet2/0/48]quit
[HX]
[HX]interface Bridge-Aggregation 1
[HX-Bridge-Aggregation1]port access vlan 1000
Configuring GigabitEthernet1/0/48 done.
Configuring GigabitEthernet2/0/48 done.
[HX-Bridge-Aggregation1]quit
[HX]interface Vlan-interface 1000
[HX-Vlan-interface1000] mad MAD BFD enable
[HX-Vlan-interface1000] mad ip address 1.1.1.1 255.255.255.252 member 1
[HX-Vlan-interface1000] mad ip address 1.1.1.2 255.255.255.252 member 2
[HX-Vlan-interface1000]quit
[HX]
Tips:
查看IRF MAD BFD检测的会话命令:display MAD BFD session,IRF设备正常情况下该会话是down的状态。
HX设备接口及OSPF配置
[HX]interface LoopBack 1
[HX-LoopBack1]ip address 10.0.0.10 32
[HX-LoopBack1]quit
[HX]interface LoopBack 10
[HX-LoopBack10]ip address 172.16.10.254 24
[HX-LoopBack10]quit
[HX]interface Route-Aggregation 1
[HX-Route-Aggregation1]ip address 10.100.10.2 30
[HX-Route-Aggregation1]quit
[HX]
[HX]interface GigabitEthernet 1/0/1
[HX-GigabitEthernet1/0/1]port link-mode route
[HX-GigabitEthernet1/0/1]port link-aggregation group 1
[HX-GigabitEthernet1/0/1]quit
[HX]
[HX]interface GigabitEthernet 2/0/1
[HX-GigabitEthernet2/0/1]port link-mode route
[HX-GigabitEthernet2/0/1]port link-aggregation group 1
[HX-GigabitEthernet2/0/1]quit
[HX]
#OSPF相关配置
[HX]ospf 1 router-id 10.0.0.10
[HX-ospf-1]area 0
[HX-ospf-1-area-0.0.0.0]network 172.16.10.0 0.0.0.255
[HX-ospf-1-area-0.0.0.0]network 10.100.10.0 0.0.0.3
[HX-ospf-1-area-0.0.0.0]quit
[HX]
#console接口设置永不超时,方便调试使用
[HX]line console 0 1
[HX-line-console0-1]idle-timeout 0
[HX-line-console0-1]quit
[HX]
[HX]ip ttl-expires enable
[HX]ip unreachables enable
Tips:
查看二层聚合接口所用的物理接口命令,如查看二层聚合口1;
display link-aggregation verbose Bridge-Aggregation 1
查看三层聚合接口所用的物理接口命令,如查看三层聚合口1;
display link-aggregation verbose Route-Aggregation 1
ChuKou-R设备配置
R_1设备IRF配置
system-view
#框式设备通过以下命令,切换成irf的工作模式
#设备切换成IRF工作模式将自动重启
[H3C]chassis convert mode irf
The device will switch to IRF mode and reboot.
You are recommended to save the current running configuration and specify the configuration file for the next startup. Continue? [Y/N]:y
Now rebooting, please wait…
%Feb 21 13:54:25:671 2023 R_1 DEV/5/SYSTEM_REBOOT: System is rebooting now.
[H3C]sysname R_1
#把R_1设备IRF优先级设置为30
[R_1]irf member 1 priority 30
[R_1]interface GigabitEthernet 1/0/0
[R_1-GigabitEthernet1/0/0]shutdown
[R_1-GigabitEthernet1/0/0]quit
[R_1]irf-port 1/2
[R_1-irf-port1/2]port group interface GigabitEthernet 1/0/0
[R_1-irf-port1/2]quit
[R_1]
[R_1]interface GigabitEthernet 1/0/0
[R_1-GigabitEthernet1/0/0]undo shutdown
[R_1-GigabitEthernet1/0/0]quit
[R_1]
[R_1]irf-port-configuration active
[R_1]save force
R_2设备IRF配置
system-view
#框式设备通过以下命令,切换成irf的工作模式
#设备切换成IRF工作模式将自动重启
[H3C]chassis convert mode irf
system-view
[H3C]sysname R_2
#修改R_2的IRF编号、保存配置并重启
#默认情况下,该设备的IRF优先级设置为1
[R_2]irf member 1 renumber 2
[R_2]save force
[R_2]quit
reboot
#
[R_2]interface GigabitEthernet 2/0/0
[R_2-GigabitEthernet2/0/0]shutdown
[R_2-GigabitEthernet2/0/0]quit
[R_2]irf-port 2/1
[R_2-irf-port2/1]port group interface GigabitEthernet 2/0/0
[R_2-irf-port2/1]quit
[R_2]interface GigabitEthernet 2/0/0
[R_2-GigabitEthernet2/0/0]undo shutdown
[R_2-GigabitEthernet2/0/0]quit
#务必先保存配置再激活IRF配置
[R_2]save force
[R_2]
#激活IRF配置,R_2设备自动重启并同步R_1主设备的配置文件
#设备重新启动后,两台设备组成IRF设备
[R_2]irf-port-configuration active
[HX_2]save force
[HX_2]
ChuKou-R设备IRF MAD BFD检测配置
#对R_1和R_2组成IRF设备进行重命名为ChuKou-R
[R_1]sysname ChuKou-R
[ChuKou-R]
[ChuKou-R]line console 0 1
[ChuKou-R-line-console0-1]idle-timeout 0
[ChuKou-R-line-console0-1]quit
[ChuKou-R]
[ChuKou-R]interface Route-Aggregation5
[ChuKou-R-Route-Aggregation5] mad MAD BFD enable
[ChuKou-R-Route-Aggregation5] mad ip address 1.1.1.1 255.255.255.252 member 1
[ChuKou-R-Route-Aggregation5] mad ip address 1.1.1.2 255.255.255.252 member 2
[ChuKou-R-Route-Aggregation5]quit
[ChuKou-R]
[ChuKou-R]interface GigabitEthernet 1/5/0
[ChuKou-R-GigabitEthernet1/5/0]port link-aggregation group 5
[ChuKou-R-GigabitEthernet1/5/0]quit
[ChuKou-R]
[ChuKou-R]interface GigabitEthernet 2/5/0
[ChuKou-R-GigabitEthernet2/5/0]port link-aggregation group 5
[ChuKou-R-GigabitEthernet2/5/0]quit
[ChuKou-R]
ChuKou-R设备接口及OSPF配置
[ChuKou-R]interface LoopBack 1
[ChuKou-R-LoopBack1]ip address 10.0.0.100 32
[ChuKou-R-LoopBack1]quit
[ChuKou-R]interface Route-Aggregation 1
[ChuKou-R-Route-Aggregation1]ip address 10.100.10.1 30
[ChuKou-R-Route-Aggregation1]quit
[ChuKou-R]
[ChuKou-R]interface Route-Aggregation 11
[ChuKou-R-Route-Aggregation11]ip address 10.100.11.1 30
[ChuKou-R-Route-Aggregation11]quit
[ChuKou-R]
[ChuKou-R]interface Route-Aggregation 12
[ChuKou-R-Route-Aggregation12]ip address 10.100.12.1 30
[ChuKou-R-Route-Aggregation12]quit
[ChuKou-R]
[ChuKou-R]interface GigabitEthernet 1/0/1
[ChuKou-R-GigabitEthernet1/0/1]port link-aggregation group 1
[ChuKou-R-GigabitEthernet1/0/1]quit
[ChuKou-R]
[ChuKou-R]interface GigabitEthernet 2/0/1
[ChuKou-R-GigabitEthernet2/0/1]port link-aggregation group 1
[ChuKou-R-GigabitEthernet2/0/1]quit
[ChuKou-R]
[ChuKou-R]interface GigabitEthernet 1/6/0
[ChuKou-R-GigabitEthernet1/6/0]port link-aggregation group 11
[ChuKou-R-GigabitEthernet1/6/0]quit
[ChuKou-R]
[ChuKou-R]interface GigabitEthernet 2/6/0
[ChuKou-R-GigabitEthernet2/6/0]port link-aggregation group 11
[ChuKou-R-GigabitEthernet2/6/0]quit
[ChuKou-R]
[ChuKou-R]interface GigabitEthernet 1/6/1
[ChuKou-R-GigabitEthernet1/6/1]port link-aggregation group 12
[ChuKou-R-GigabitEthernet1/6/1]quit
[ChuKou-R]
[ChuKou-R]interface GigabitEthernet 2/6/1
[ChuKou-R-GigabitEthernet2/6/1]port link-aggregation group 12
[ChuKou-R-GigabitEthernet2/6/1]quit
[ChuKou-R]
#OSPF相关配置
[ChuKou-R]ospf 1 router-id 10.0.0.100
[ChuKou-R-ospf-1]area 0
[ChuKou-R-ospf-1-area-0.0.0.0]network 10.100.10.0 0.0.0.3
[ChuKou-R-ospf-1-area-0.0.0.0]network 10.100.11.0 0.0.0.3
[ChuKou-R-ospf-1-area-0.0.0.0]network 10.100.12.0 0.0.0.3
[ChuKou-R-ospf-1-area-0.0.0.0]quit
[ChuKou-R-ospf-1]quit
[ChuKou-R]
[ChuKou-R]ip ttl-expires enable
[ChuKou-R]ip unreachables enable
FenZhi01设备接口及OSPF配置
system-view
[H3C]sysname FenZhi01
[FenZhi01]
[FenZhi01]line console 0
[FenZhi01-line-console0]idle-timeout 0
[FenZhi01-line-console0]quit
[FenZhi01] ip ttl-expires enable
[FenZhi01] ip unreachables enable
#
[FenZhi01]interface LoopBack 1
[FenZhi01-LoopBack1]ip address 10.0.0.11 32
[FenZhi01-LoopBack1]quit
[FenZhi01]interface LoopBack 11
[FenZhi01-LoopBack11]ip address 172.16.11.254 24
[FenZhi01-LoopBack11]quit
[FenZhi01]
[FenZhi01]interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/2
[FenZhi01-if-range]port link-mode route
[FenZhi01-if-range]port link-aggregation group 11
[FenZhi01-if-range]quit
[FenZhi01]
#OSPF相关配置
[FenZhi01]ospf 1 router-id 10.0.0.11
[FenZhi01-ospf-1]area 0
[FenZhi01-ospf-1-area-0.0.0.0]network 10.100.11.0 0.0.0.3
[FenZhi01-ospf-1-area-0.0.0.0]network 172.16.11.0 0.0.0.255
[FenZhi01-ospf-1-area-0.0.0.0]quit
[FenZhi01-ospf-1]quit
[FenZhi01]
FenZhi02设备接口及OSPF配置
system-view
[H3C]sysname FenZhi02
[FenZhi02]
[FenZhi02]interface LoopBack 1
[FenZhi02-LoopBack1]ip address 10.0.0.12 32
[FenZhi02-LoopBack1]quit
[FenZhi02]int
[FenZhi02]interface LoopBack 12
[FenZhi02-LoopBack12]ip address 172.16.12.254 24
[FenZhi02-LoopBack12]quit
[FenZhi02]
[FenZhi02]interface Route-Aggregation 12
[FenZhi02-Route-Aggregation12]ip address 10.100.12.2 30
[FenZhi02-Route-Aggregation12]quit
[FenZhi02]
[FenZhi02]interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/2
[FenZhi02-if-range]port link-mode route
[FenZhi02-if-range]port link-aggregation group 12
[FenZhi02-if-range]quit
[FenZhi02]
#OSPF相关配置
FenZhi02]ospf 1 router-id 10.0.0.12
[FenZhi02-ospf-1]area 0
[FenZhi02-ospf-1-area-0.0.0.0]network 10.100.12.0 0.0.0.3
[FenZhi02-ospf-1-area-0.0.0.0]network 172.16.12.0 0.0.0.255
[FenZhi02-ospf-1]quit
[FenZhi02]
IRF组网目标验证和测试
查看HX设备IRF状态
查看ChuKou-R设备IRF状态
查看HX设备的ospf路由表并进行ping测试
Tips:
命令释义:ping -c 2 -a 172.16.10.254 172.16.11.254
-c 2:
指发送icmp报文的数量为2
-a 172.16.10.254 172.16.11.254:
指携带源地址172.16.10.254发送icmp至目标主机172.16.11.254
查看FenZhi01设备的ospf路由表并进行ping测试
查看FenZhi02设备的ospf路由表并进行ping测试
总结
盒式设备与框式设备配置IRF略有差异,但是IRF配置逻辑是相同的。