配置ISP环境
[ISP1]ospf 1 router-id 1.1.1.1
[ISP1-ospf-1]area 0
[ISP1-ospf-1-area-0.0.0.0]network 100.1.1.0 0.0.0.255
[ISP1-ospf-1-area-0.0.0.0]quit
[ISP1-ospf-1]import-route direct type 1
[ISP1-ospf-1]quit
[ISP2]ospf 1 router-id 2.2.2.2
[ISP2-ospf-1]area 0
[ISP2-ospf-1-area-0.0.0.0]network 200.1.1.0 0.0.0.255
[ISP2-ospf-1-area-0.0.0.0]quit
[ISP2-ospf-1]import-route direct type 1
[ISP2-ospf-1]quit
[NET]ospf 1 router-id 3.3.3.3
[NET-ospf-1]area 0
[NET-ospf-1-area-0.0.0.0]network 100.1.1.0 0.0.0.255
[NET-ospf-1-area-0.0.0.0]network 200.1.1.0 0.0.0.255
[NET-ospf-1-area-0.0.0.0]quit
[NET-ospf-1]import-route direct type 1
[NET-ospf-1]quit
----------------------------------------------------------------------------
配置BFD和默认路由
[GW]bfd
[GW-bfd]quit
[GW]bfd to-r1 bind peer-ip 10.1.1.1 interface GigabitEthernet 1/0/0
[GW-bfd-session-to-r1]discriminator local 1
[GW-bfd-session-to-r1]discriminator remote 2
[GW-bfd-session-to-r1]commit
[GW-bfd-session-to-r1]quit
[ISP1]bfd
[ISP1-bfd]quit
[ISP1]bfd to-r1 bind peer-ip 10.1.1.2 interface GigabitEthernet 0/0/0
[ISP1-bfd-session-to-r1]discriminator local 2
[ISP1-bfd-session-to-r1]discriminator remote 1
[ISP1-bfd-session-to-r1]commit
[ISP1-bfd-session-to-r1]quit
[GW]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1 track bfd-session to-r1 //默认路由与BFD联动
[GW]ip route-static 0.0.0.0 0.0.0.0 20.1.1.1 preference 70
---------------------------------------------------------------------------------
查看以及验证
[GW]display bfd session all //查看链路的BFD会话的状态
GW-ISP1的链路状态正常的时候,走ISP1的路由
GW-ISP1的链路状态down的时候,走ISP2的路由
模拟故障:down掉交换机的一个口
故障恢复之后,继续走ISP1