拓扑图
配置流程
配置SW1与SW2堆叠
一、SW1:
- shutdown 物理端口
- 配置堆叠优先级,优先级高的成为主设备
- 创建堆叠逻辑接口,将物理接口加入到堆叠逻辑接口中
二、SW1:
sysname SW1
#
irf member 1 priority 6
#
irf-port 1/1
port group interface FortyGigE1/0/53
port group interface FortyGigE1/0/54
#
三、SW2:
- 配置堆叠ID为2,保存并重启
irf member 1 renumber 2
#
- 重启完成后,将物理接口shutdown
- 创建堆叠逻辑接口,将物理接口加入到堆叠逻辑接口中
SW2:
sysname SW2
#
interface FortyGigE2/0/53
shutdown
#
interface FortyGigE2/0/54
shutdown
#
irf-port 2/2
port group interface FortyGigE2/0/53
port group interface FortyGigE2/0/54
#
注意:堆叠逻辑接口交叉相连
- irf-port 1/1:第一个1代表堆叠ID,第二个1代表接口ID
- irf-port 2/2:第一个2代表堆叠ID,第二个2代表接口ID
- 堆叠接口1与接口2相连
四、SW1:
- 将加入到堆叠逻辑接口的物理接口undo shutdown
- 保存配置
- 激活配置
int range FortyGigE 1/0/53 FortyGigE 1/0/54
undo shutdown
#
irf-port-configuration active
#
五、SW2:
- 将加入到堆叠逻辑接口的物理接口undo shutdown
- 保存配置
- 激活配置
- 交换机将自动重启
int range FortyGigE 2/0/53 FortyGigE 2/0/54
undo shutdown
#
irf-port-configuration active
#
重启后两台设备虚拟成一台设备
配置ACC1与ACC2堆叠
配置堆叠域为1(默认为0),其他步骤同上
irf domain 1
#
配置成功后
配置链路聚合
SW1和ACC1链路聚合
interface Bridge-Aggregation1
link-aggregation mode dynamic
#
interface Ten-GigabitEthernet1/0/49
port link-aggregation group 1
#
interface Ten-GigabitEthernet1/0/50
port link-aggregation group 1
#
interface Ten-GigabitEthernet2/0/49
port link-aggregation group 1
#
interface Ten-GigabitEthernet2/0/50
port link-aggregation group 1
#
查看聚合端口状态
SW1与ACC3间链路聚合
SW1:
interface Bridge-Aggregation2
link-aggregation mode dynamic
#
interface Ten-GigabitEthernet1/0/52
port link-aggregation group 2
#
interface Ten-GigabitEthernet2/0/51
port link-aggregation group 2
#
ACC3:
interface Bridge-Aggregation2
link-aggregation mode dynamic
#
interface Ten-GigabitEthernet1/0/51
port link-aggregation group 2
#
interface Ten-GigabitEthernet1/0/52
port link-aggregation group 2
#
SW1与R1之间三层链路聚合
除配置链路聚合外,还可以配置动态路由选择协议(如OSPF)
SW1:
interface Route-Aggregation1
ip address 10.1.100.1 255.255.255.0
link-aggregation mode dynamic
#
int range g1/0/1 g2/0/1
port link-mode route
port link-aggregation group 1
#
R1:
sysname R1
#
interface Route-Aggregation1
ip address 10.1.100.254 255.255.255.0
link-aggregation mode dynamic
#
int range GigabitEthernet 0/0/1 GigabitEthernet 0/0/2
port link-aggregation group 1
#
interface GigabitEthernet0/0/0
ip address 150.1.1.1 255.255.255.0
#
配置VLAN
SW1:
vlan 10
#
vlan 20
#
interface Vlan-interface10
ip address 10.1.10.254 255.255.255.0
#
interface Vlan-interface20
ip address 10.1.20.254 255.255.255.0
#
interface Bridge-Aggregation1
port link-type trunk
port trunk permit vlan 10 20
#
interface Bridge-Aggregation2
port link-type trunk
port trunk permit vlan 10 20
#
ACC1:
vlan 10
#
vlan 20
#
interface Bridge-Aggregation1
port link-type trunk
port trunk permit vlan 10 20
#
interface GigabitEthernet1/0/1
port access vlan 10
#
interface GigabitEthernet2/0/1
port access vlan 20
#
ACC3:
vlan 10
#
vlan 20
#
interface Bridge-Aggregation2
port link-type trunk
port trunk permit vlan 10 20
#
interface GigabitEthernet1/0/1
port access vlan 20
#
interface GigabitEthernet1/0/1
port access vlan 20
#
配置路由及NAT
R1:
ip route-static 0.0.0.0 0 150.1.1.254
ip route-static 10.1.0.0 16 10.1.100.1
#
acl basic 2000
rule 5 permit source 10.1.0.0 0.0.255.255
#
interface GigabitEthernet0/0/0
nat outbound 2000
#
SW1:
ip route-static 0.0.0.0 0 10.1.100.254
#
ISP:
interface GigabitEthernet0/0/0
ip address 150.1.1.254 255.255.255.0
#
interface LoopBack0
ip address 6.6.6.6 255.255.255.255
#
测试访问6.6.6.6
多主检测MAD
未配置多主检测的情况下
- 由于堆叠系统中所有成员交换机都使用同一个IP地址和MAC地址(堆叠系统MAC),一个堆叠分裂后,可能产生多个具有相同IP地址和MAC地址的堆叠系统,引起网络故障。
配置多主检测MAD
- 配置了双主检测后,堆叠主上的堆叠组件就会按周期(1秒)从使能双主检测的端口上发送检测报文。报文中携带了设备MAC信息,以及堆叠竞争条件。竞争失败的设备会关闭除保留端口以外的其它所有物理端口,以保证该设备不再转发业务报文。
测试删除堆叠连线
堆叠分裂
2台设备配置相同,IP和MAC相同
PC1无法ping通网关了
配置LACP-MAD
LACP MAD检测依赖于LACP协议,因此只在动态聚合接口下生效。
为了防止IRF级联组网时,本IRF的MAD检测报文转发到邻居IRF中影响邻居IRF的MAD检测,执行mad enable命令时,系统会要求用户输入IRF域编号。
SW1:
interface Bridge-Aggregation1
mad enable
#
同理,ACC1上开启MAD
ACC1:
interface Bridge-Aggregation1
mad enable
#
测试删除堆叠线
堆叠分裂
备堆叠设备的除保留接口外的接口DOWN
堆叠主设备的接口正常,保证业务正常转发
测试访问6.6.6.6
恢复堆叠连线,备设备重启,堆叠恢复,被置为DOWN的接口恢复UP
补充:由于模拟器PC不支持双归接入,对于服务器来说,可以双归接入接入层交换机
(上面堆叠分裂,堆叠备设备的接口DOWN,ACC2上连接PC2的接口也会变为DOWN,由于PC2单归接入,流量中断)