说明
Monitor Link是Smart Link的补充,Smart Link无法感知上游设备的链路状态。Smart Link作为Monitor Link的上行链路,Monitor Link监控上行链路,上行链路出现故障,Moniot Link会把下行接口强制Down。
拓扑图
SW2的 G0/0/2 和G0/0/4 组成Smart link, 然后这个Smart Link和G0/0/1一起组成Monitor Link。
SW3 的G0/0/1 和 G0/0/2 组成Monitor Link。
配置Monitor Link
配置VLAN和Trunk
SW1,SW2,SW3,位置4个VLAN,VLAN 10,20,30,40
3台机器都如下配置
[SW1]vlan batch 10 20 30 40
[SW1]interface g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type trunk
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40
[SW2]vlan batch 10 20 30 40
[SW2]interface g0/0/1
[SW2-GigabitEthernet0/0/1]port link-type trunk
[SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW2-GigabitEthernet0/0/1]interface g0/0/2
[SW2-GigabitEthernet0/0/2]port link-type trunk
[SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40
[SW2-GigabitEthernet0/0/2]interface g0/0/3
[SW2-GigabitEthernet0/0/3]port link-type trunk
[SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20 30 40
[SW2-GigabitEthernet0/0/3]interface g0/0/4
[SW2-GigabitEthernet0/0/4]port link-type trunk
[SW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 10 20 30 40
[SW3]interface g0/0/1
[SW3-GigabitEthernet0/0/1]port link-type trunk
[SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW3-GigabitEthernet0/0/1]interface g0/0/2
[SW3-GigabitEthernet0/0/2]port link-type trunk
[SW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40
[SW3-GigabitEthernet0/0/2]interface g0/0/3
[SW3-GigabitEthernet0/0/3]port link-type trunk
[SW3-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20 30 40
SW1和SW2创建Smart Link组
[SW1]smart-link group 1
[SW2]smart-link group 1
把接口成员加入Smart Link组
[SW1]int GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]stp disable
[SW1-GigabitEthernet0/0/1]q
[SW1]int GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]stp disable
[SW1]smart-link group 1
[SW1-smlk-group1]port GigabitEthernet 0/0/1 master //设置主接口
[SW1-smlk-group1]port GigabitEthernet 0/0/2 slave //设置从接口
[SW2]int GigabitEthernet 0/0/2
[SW2-GigabitEthernet0/0/2]stp disable
[SW2]int GigabitEthernet 0/0/4
[SW2-GigabitEthernet0/0/4]stp disable
[SW2]smart-link group 1
[SW2-smlk-group1]port GigabitEthernet 0/0/2 master
[SW2-smlk-group1]port GigabitEthernet 0/0/4 slave
查看下
配置Flush报文
在SW1 SW2 SW3上配置发送和接收Flush报文
[SW1]smart-link group 1
[SW1-smlk-group1]flush send control-vlan 10 password simple abc123 //发送密码abc123
[SW2]interface GigabitEthernet 0/0/1
[SW2-GigabitEthernet0/0/1]smart-link flush receive control-vlan 10 password simple abc123 //接收密码abc123
[SW2]int GigabitEthernet 0/0/3
[SW2-GigabitEthernet0/0/3]smart-link flush receive control-vlan 10 password simple abc123
[SW3]int GigabitEthernet 0/0/2
[SW3-GigabitEthernet0/0/2]smart-link flush receive control-vlan 10 password simple abc123
[SW3]int GigabitEthernet 0/0/3
[SW3-GigabitEthernet0/0/3]smart-link flush receive control-vlan 10 password simple abc123
设置回切功能和时间
[SW1]smart-link group 1
[SW1-smlk-group1]restore enable //开启回切
[SW1-smlk-group1]timer wtr 30 //回切时间30s
[SW2]smart-link group 1
[SW2-smlk-group1]restore enable
[SW2-smlk-group1]timer wtr 30
开启Smart Link
S1和S2开启
[SW1]smart-link group 1
[SW1-smlk-group1]smart-link enable
[SW2]smart-link group 1
[SW2-smlk-group1]smart-link enable
创建Monitor Link组
在S2和S3创建
[SW2]monitor-link group 1
[SW3]monitor-link group 1
查看命令 dis monitor-link group 1
加入上行和下行链路
在S2和S3配置
[SW2]monitor-link group 1
[SW2-mtlk-group1]smart-link group 1 uplink //上行链路SMLK1 必须up
[SW2-mtlk-group1]port GigabitEthernet 0/0/1 downlink //如果Smart link down了,强制G0/0/1 接口down
[SW3]monitor-link group 1
[SW3-mtlk-group1]port GigabitEthernet 0/0/1 uplink
[SW3-mtlk-group1]port GigabitEthernet 0/0/2 downlink
设置回切Monitor和回切时间为4s
在S2和S3配置
[SW2]monitor-link group 1
[SW2-mtlk-group1]timer recover-time 4 //默认时间是3s
[SW3]monitor-link group 1
[SW3-mtlk-group1]timer recover-time 4
故障演习
模拟S3故障
把S3的G0/0/1 接口Down掉
[SW3]int GigabitEthernet 0/0/1
[SW3-GigabitEthernet0/0/1]shutdown
看到G0/0/2 被强制接口Down了
在开启G0/0/1接口
[SW3]int GigabitEthernet 0/0/1
[SW3-GigabitEthernet0/0/1]undo shutdown
切换成功。
模拟S2故障
把S2的G0/0/2接口Down
[SW2]int GigabitEthernet 0/0/2
[SW2-GigabitEthernet0/0/2]shutdown
我们先查看Smart Link,发现已经切换了
在查看Monitor Link
没切换,因为Smart Link组中只断了一个,所以整个Smart Link组没有断
把S2的G0/0/4接口也Down了
[SW2]int GigabitEthernet 0/0/4
[SW2-GigabitEthernet0/0/4]shutdown
现在Down了
我们在去查看SW1的Smart Link发现也切换了。
我们把S2的接口都up
[SW2]int GigabitEthernet 0/0/4
[SW2-GigabitEthernet0/0/4]undo shutdown
[SW2]int GigabitEthernet 0/0/2
[SW2-GigabitEthernet0/0/2]undo shutdown
Monitor Link恢复了
SW1也ok了
实验完成