STP故障01-STP端口问题
配置信息如下:
1、 防火墙配置:
sysname FW01#hrp enablehrp interface GigabitEthernet1/0/1 remote 1.1.1.3hrp standby config enable#interface GigabitEthernet1/0/0.10vlan-type dot1q 10description To_CE1_test1ip address 10.10.1.2 255.255.255.0vrrp vrid 1 Virtual-ip 10.10.1.1 activeservice-manage ping permitservice-manage ssh permit#interface GigabitEthernet1/0/0.20vlan-type dot1q 20description To_CE1_test2ip address 10.11.1.2 255.255.255.0vrrp vrid 1 Virtual-ip 10.11.1.1 activeservice-manage ping permitservice-manage ssh permit#interface GigabitEthernet1/0/1undo shutdownip address 1.1.1.2 255.255.255.0vrrp vrid 1 Virtual-ip 1.1.1.1 activeservice-manage ping permitservice-manage ssh permit#firewall zone trustset priority 85add interface GigabitEthernet1/0/0.20#firewall zone untrustset priority 5add interface GigabitEthernet1/0/0.10#firewall zone name hrp id 4set priority 95add interface GigabitEthernet1/0/1#security-policydefault action permit#ip route-static 10.9.1.0 255.255.255.0 10.10.1.4 description CE1_VRF-test1ip route-static 10.12.1.0 255.255.255.0 10.11.1.4 description CE1_VRF-test2防火墙FW-02与FW-01配置类似2、 交换机配置:
sysname CE1#vlan batch 10 20#ip -instance test1ipv4-familyroute-distinguisher 10:1#ip -instance test2ipv4-familyroute-distinguisher 20:1#interface Vlanif10description To_FW_untrustip binding -instance test1ip address 10.10.1.4 255.255.255.0#interface Vlanif20description To_FW_trustip binding -instance test2ip address 10.11.1.4 255.255.255.0#interface GE1/0/0undo shutdownport link-type trunkundo port trunk allow-pass vlan 1port trunk allow-pass vlan 10 20#interface GE1/0/1undo shutdownport link-type trunkundo port trunk allow-pass vlan 1port trunk allow-pass vlan 10 20#interface LoopBack1description Internetip binding -instance test1ip address 10.9.1.1 255.255.255.0#interface LoopBack2description clientip binding -instance test2ip address 10.12.1.1 255.255.255.0#ip route-static -instance test1 10.12.1.0 255.255.255.0 10.10.1.1 description FW-untrustip route-static -instance test2 10.9.1.0 255.255.255.0 10.11.1.1 description FW-trunst现在我们来做个场景模拟,Internet访问客户侧业务 或者 客户侧访问Internet业务,在客户正在访问的情况下,刚好我们要操作防火墙,会导致防火墙主备切换,那是否会对客户产生影响?如果有,影响有多大?
1、带着这个问题,选择Internet侧长ping客户侧设备,然后我们切换防火墙,看是否会掉包;
2、我们可以发现掉了两个包,我们只断了防火墙连接交换机的端口,HRP互连端口并没有关闭,那为什么会掉包,难道是因为会话没有同步?
3、可以发现,还是掉了两个包,这明显不是防火墙会话原因;数据转发一定离不开ARP及MAC表,我们可以观察下防火墙上的ARP表项,看是否是防火墙ARP表问题;
通过查看ARP表发现,防火墙连接交换机端口UP后,是经过了1~2秒才学到了交换机10.10.1.4的ARP信息,所以掉包应该是这个原因导致。
延伸:
在上面第1步测试中,用真机CE设备测试,应该是掉5个包;这是为什么呢?在CE交换机中,针对STP是有优化的,具体优化如下:端口使能生成树协议后,会默认启动边缘端口的自动探测功能,当端口在(2 x Hello Timer +1)秒时间内收不到BPDU报文,自动将端口设置为边缘端口;如果在接口视图下配置了stp edged-port enable 或 stp edged-port disable、或者在系统视图下配置stp edged-port default,边缘端口自动探测功能就不生效了。我们可以看CE1交换机的GE1/0/0端口信息:
可以看到,CE1交换机的GE1/0/0端口显示边缘端口以开启,但实际上我们在端口下并未配置边缘端口,这就是CE交换机边缘端口的自动探测功能导致的,在经过5S后,GE1/0/0端口还未收到BPDU报文,就认为对端可能是PC,可以将该端口设置为边缘端口,避免了STP/mstp端口的慢收敛。
精彩评论