1.组网需求
Switch A、Switch B和Switch C属于同一OSPF区域,通过OSPF协议实现网络互连。要求当Switch A和Switch B之间的链路出现故障时,业务可以快速切换到链路B上。
2.配置步骤
1)配置各交换机接口的IP地址和OSPF协议
配置各交换机之间采用OSPF协议进行互连,确保Switch A、Switch B和Switch C之间能够在网络层互通,并且各交换机之间能够借助OSPF协议实现动态路由更新。
2)配置OSPF快读重路由
OSPF支持快速重路由配置有两种配置方法,可以任选一种。
方法一:使能Switch A和Switch B的OSPF快速重路由功能(通过LFA算法选取备份下一跳信息)
SW A [SwitchA] ospf 1 [SwitchA-ospf-1] fast-reroute lfa SW B [SwitchB] ospf 1 [SwitchB-ospf-1] fast-reroute lfa
方法二:使能Switch A和Switch B的OSPF快速重路由功能(通过路由策略指定备份下一跳)
SW A [SwitchA] ip prefix-list abc index 10 permit 4.4.4.4 32 [SwitchA] route-policy frr permit node 10 [SwitchA-route-policy-frr-10] if-match ip address prefix-list abc [SwitchA-route-policy-frr-10] apply fast-reroute backup-interface vlan-interface 100 backup-nexthop 12.12.12.2 [SwitchA-route-policy-frr-10] quit [SwitchA] ospf 1 [SwitchA-ospf-1] fast-reroute route-policy frr
SW B [SwitchB] ip prefix-list abc index 10 permit 1.1.1.1 32 [SwitchB] route-policy frr permit node 10 [SwitchB-route-policy-frr-10] if-match ip address prefix-list abc [SwitchB-route-policy-frr-10] apply fast-reroute backup-interface vlan-interface 101 backup-nexthop 24.24.24.2 [SwitchB-route-policy-frr-10] quit [SwitchB] ospf 1 [SwitchB-ospf-1] fast-reroute route-policy frr
3.配置验证
# 在Switch A上查看4.4.4.4/32网段路由,可以看到备份下一跳信息。 [SwitchA] display ip routing-table 4.4.4.4 verbose Summary count : 1 Destination: 4.4.4.4/32 Protocol: O_INTRA Process ID: 1 SubProtID: 0x1 Age: 04h20m37s Cost: 1 Preference: 10 IpPre: N/A QosLocalID: N/A Tag: 0 State: Active Adv OrigTblID: 0x0 OrigVrf: default-vrf TableID: 0x2 OrigAs: 0 NibID: 0x26000002 LastAs: 0 AttrID: 0xffffffff Neighbor: 0.0.0.0 Flags: 0x1008c OrigNextHop: 13.13.13.2 Label: NULL RealNextHop: 13.13.13.2 BkLabel: NULL BkNextHop: 12.12.12.2 SRLabel: NULL BkSRLabel: NULL SIDIndex: NULL InLabel: NULL Tunnel ID: Invalid Interface: Vlan-interface200 BkTunnel ID: Invalid BkInterface: Vlan-interface100 FtnIndex: 0x0 TrafficIndex: N/A Connector: N/A PathID: 0x0 LinkCost: 0 MicroSegID: 0
# 在Switch B上查看1.1.1.1/32网段路由,可以看到备份下一跳信息。 [SwitchB] display ip routing-table 1.1.1.1 verbose Summary count : 1 Destination: 1.1.1.1/32 Protocol: O_INTRA Process ID: 1 SubProtID: 0x1 Age: 04h20m37s Cost: 1 Preference: 10 IpPre: N/A QosLocalID: N/A Tag: 0 State: Active Adv OrigTblID: 0x0 OrigVrf: default-vrf TableID: 0x2 OrigAs: 0 NibID: 0x26000002 LastAs: 0 AttrID: 0xffffffff Neighbor: 0.0.0.0 Flags: 0x1008c OrigNextHop: 13.13.13.1 Label: NULL RealNextHop: 13.13.13.1 BkLabel: NULL BkNextHop: 24.24.24.2 SRLabel: NULL BkSRLabel: NULL SIDIndex: NULL InLabel: NULL Tunnel ID: Invalid Interface: Vlan-interface200 BkTunnel ID: Invalid BkInterface: Vlan-interface101 FtnIndex: 0x0 TrafficIndex: N/A Connector: N/A PathID: 0x0 LinkCost: 0 MicroSegID: 0
看看天上,于是我去了满是风雪的地方