IRF它的核心思想是将多台设备连接在一起,进行必要的配置后,虚拟化成一台设备
H3C模拟器版本
SW1:
system-view
[H3C]sysname SW1
[SW1]
SW2:
system-view
[H3C]sysname SW2
[SW2]
SW1:
[SW1]interface Ten-GigabitEthernet1/0/49
[SW1-Ten-GigabitEthernet1/0/49]shutdown
[SW1-Ten-GigabitEthernet1/0/49]quit
SW2:
[SW2]interface Ten-GigabitEthernet1/0/49
[SW2-Ten-GigabitEthernet1/0/49]shutdown
[SW2-Ten-GigabitEthernet1/0/49]quit
SW1:
[SW1]irf domain 10
SW2:
[SW2]irf domain 10
SW1:
[SW1]irf member 1 renumber 1
Renumbering the member ID may result in configuration change or loss. Continue?[Y/N]:y
SW2:
[SW2]irf member 1 renumber 2
Renumbering the member ID may result in configuration change or loss. Continue?[Y/N]:y
如果SW1使用 1/1,那SW2只能使用1/2
SW1:
[SW1]irf-port 1/1
[SW1-irf-port1/1]port group interface Ten-GigabitEthernet 1/0/49
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.
[SW1-irf-port1/1]quit
SW2:
[SW2]irf-port 1/2
[SW2-irf-port1/2]port group interface Ten-GigabitEthernet 1/0/49
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]quit
SW1:
[SW1]interface Ten-GigabitEthernet1/0/49
[SW1-Ten-GigabitEthernet1/0/49]un
[SW1-Ten-GigabitEthernet1/0/49]undo shu
[SW1-Ten-GigabitEthernet1/0/49]undo shutdown
[SW1-Ten-GigabitEthernet1/0/49]quit
[SW1]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]interface Ten-GigabitEthernet 1/0/49
[SW2-Ten-GigabitEthernet1/0/49]undo shutdown
[SW2-Ten-GigabitEthernet1/0/49]quit
[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.
SW1:
[SW1]irf-port-configuration active
SW2:
[SW2]irf-port-configuration active
重启SW2
SW1是Master,SW2是Standby
*表示Master设备
+表示当前通过那台设备登陆
确定成员设备角色为主设备或从设备的过程称为角色选举。角色选举会在以下情况下进行:IRF 建立、主设备离开或者故障、两个 IRF 合并等。
角色选举规则如下:
默认优先级为1,更改后并不会重新选举,需要member 1重启(谨慎)
[SW1]irf member 2 priority 10
#irf区域设置
[H3C]sysname SW1
[SW1]irf domain 10
#设置member 1优先级
[SW1]irf member 1 priority 10
#关闭irf物理端口
[SW1]interface range Ten-GigabitEthernet 1/0/49 to Ten-GigabitEthernet 1/0/50
[SW1-if-range]shutdown
[SW1-if-range]quit
#创建irf-port 1/1 ( member号/逻辑口编号),然后加入irf物理端口
[SW1]irf-port 1/1
[SW1-irf-port1/1]port group interface Ten-GigabitEthernet 1/0/49
[SW1-irf-port1/1]port group interface Ten-GigabitEthernet 1/0/50
[SW1-irf-port1/1]quit
#开启irf物理端口,保存配置
[SW1]interface range Ten-GigabitEthernet 1/0/49 to Ten-GigabitEthernet 1/0/50
[SW1-if-range]undo shutdown
[SW1-if-range]quit
[SW1]save
#激活irf端口下的配置
[SW1]irf-port-configuration active
#irf区域设置
[H3C]sysname SW2
[SW2]irf domain 10
#设置member成员编号(irf内两台设备成员编号不能一致)
[SW2]irf member 1 renumber 2
#重启
reboot
#关闭irf物理端口
[SW2]interface range Ten-GigabitEthernet 2/0/49 to Ten-GigabitEthernet 2/0/50
[SW2-if-range]shutdown
[SW2-if-range]quit
#创建irf-port 2/2 ( member号/逻辑口编号,逻辑口编号两台设备之间只能选1或者2,不能同时1或者同时2),然后加入irf物理端口
[SW2]irf-port 2/2
[SW2-irf-port2/2]port group interface Ten-GigabitEthernet 2/0/49
[SW2-irf-port2/2]port group interface Ten-GigabitEthernet 2/0/50
[SW2-irf-port2/2]quit
#开启irf物理端口,保存配置
[SW2]interface range Ten-GigabitEthernet 2/0/49 to Ten-GigabitEthernet 2/0/50
[SW2-if-range]undo shutdown
[SW2-if-range]quit
[SW2]save
#激活irf端口下的配置
[SW2]irf-port-configuration active
SW2会自动重启并加入irf
将SW1的g1/0/1与g2/0/1端口做聚合1
[SW1]interface Bridge-Aggregation 1
[SW1-Bridge-Aggregation1]quit
#将物理接口加入到聚合口1
[SW1]interface GigabitEthernet 1/0/1
[SW1-GigabitEthernet1/0/1]port link-aggregation group 1
[SW1-GigabitEthernet1/0/1]quit
[SW1]interface GigabitEthernet 2/0/1
[SW1-GigabitEthernet2/0/1]port link-aggregation group 1
[SW1-GigabitEthernet2/0/1]quit
[SW1]interface Bridge-Aggregation 1
[SW1-Bridge-Aggregation1]port link-type trunk
[SW1-Bridge-Aggregation1]port trunk permit vlan 10
[SW1-Bridge-Aggregation1]quit
将SW1的g1/0/2与g2/0/2端口做聚合2
[SW1]interface Bridge-Aggregation 2
[SW1-Bridge-Aggregation2]quit
[SW1]interface GigabitEthernet 1/0/2
[SW1-GigabitEthernet1/0/2]port link-aggregation group 2
[SW1-GigabitEthernet1/0/2]quit
[SW1]interface GigabitEthernet 2/0/2
[SW1-GigabitEthernet2/0/2]port link-aggregation group 2
[SW1-GigabitEthernet2/0/2]quit
[SW1]interface Bridge-Aggregation 2
[SW1-Bridge-Aggregation2]port link-type trunk
[SW1-Bridge-Aggregation2]port trunk permit vlan 10
[SW1-Bridge-Aggregation2]quit
SW3:
[H3C]sysname SW3
[SW3]interface Bridge-Aggregation 1
[SW3-Bridge-Aggregation1]quit
[SW3]interface GigabitEthernet 1/0/1
[SW3-GigabitEthernet1/0/1]port link-aggregation group 1
[SW3-GigabitEthernet1/0/1]quit
[SW3]interface GigabitEthernet 1/0/2
[SW3-GigabitEthernet1/0/2]port link-aggregation group 1
[SW3-GigabitEthernet1/0/2]quit
[SW3]interface Bridge-Aggregation 1
[SW3-Bridge-Aggregation1]port link-type trunk
[SW3-Bridge-Aggregation1]port trunk permit vlan 10
[SW3-Bridge-Aggregation1]quit
SW4:
[H3C]sysname SW4
[SW4]interface Bridge-Aggregation 2
[SW4-Bridge-Aggregation2]quit
[SW4]interface GigabitEthernet 1/0/1
[SW4-GigabitEthernet1/0/1]port link-aggregation group 2
[SW4-GigabitEthernet1/0/1]quit
[SW4]interface GigabitEthernet 1/0/2
[SW4-GigabitEthernet1/0/2]port link-aggregation group 2
[SW4-GigabitEthernet1/0/2]quit
[SW4]interface Bridge-Aggregation 2
[SW4-Bridge-Aggregation2]port link-type trunk
[SW4-Bridge-Aggregation2]port trunk permit vlan 10
[SW4-Bridge-Aggregation2]quit
SW3
[SW3]vlan 10
[SW3-vlan10]quit
[SW3]interface GigabitEthernet 1/0/3
[SW3-GigabitEthernet1/0/3]port access vlan 10
[SW3-GigabitEthernet1/0/3]quit
SW4
[SW4]vlan 10
[SW4-vlan10]port GigabitEthernet 1/0/3
[SW4-vlan10]quit
PC1 ping PC2 聚合端口任意一条线故障都不会影响