This is a rough failover for 2 switches that have 2 links to the same ISP, and they have a xconnect between both. They run OSPF sending out a default route. Switch A is the master and Switch B is the slave. If Switch A’s primary xconnect dies, switch B will announce a default route via iBGP and OSPF to keep traffic flowing to the net.
Switch A:
interface GigabitEthernet0/1
description Primary Internet Link
no switchport
ip address 192.168.0.118 255.255.255.252
no ip redirects
no ip proxy-arp
!
interface GigabitEthernet0/2
description Layer3 To Switch B
no switchport
ip address 192.168.1.253 255.255.255.252
no ip redirects
no ip proxy-arp
ip ospf cost 10
!
router ospf 10
log-adjacency-changes
auto-cost reference-bandwidth 10000
process-min-time percent 10
traffic-share min across-interfaces
redistribute connected metric-type 1 subnets
redistribute static metric-type 1 subnets route-map REDIST-STATIC
network 192.168.1.252 0.0.0.3 area 0
maximum-paths 8
default-information originate metric 10 metric-type 1
!
router bgp 12345
no synchronization
no bgp fast-external-fallover
bgp log-neighbor-changes
network 10.10.10.0 mask 255.255.255.0
neighbor 192.168.0.117 remote-as 1111
neighbor 192.168.0.117 description Primary Internet Link
neighbor 192.168.0.117 version 4
neighbor 192.168.0.117 send-community
neighbor 192.168.0.117 prefix-list default in
neighbor 192.168.0.117 prefix-list aggregate out
neighbor 192.168.1.254 remote-as 12345
neighbor 192.168.1.254 version 4
neighbor 192.168.1.254 next-hop-self
no auto-summary
!
Switch B (backup xconnect):
interface GigabitEthernet0/1
description Layer3 to Switch A
no switchport
ip address 192.168.1.254 255.255.255.252
ip ospf cost 10
!
interface GigabitEthernet0/2
no switchport
ip address 192.168.2.121 255.255.255.252
!
router ospf 10
log-adjacency-changes
auto-cost reference-bandwidth 10000
traffic-share min across-interfaces
redistribute connected metric-type 1 subnets
network 192.168.1.252 0.0.0.3 area 0
maximum-paths 8
default-information originate metric 300 metric-type 1
!
router bgp 12345
no synchronization
no bgp fast-external-fallover
bgp log-neighbor-changes
network 10.10.10.0 mask 255.255.255.0
neighbor 192.168.2.121 remote-as 1111
neighbor 192.168.2.121 prefix-list default in
neighbor 192.168.2.121 prefix-list aggregate out
neighbor 192.168.2.121 route-map backup-in in
neighbor 192.168.2.121 route-map backup-out out
neighbor 192.168.1.253 remote-as 12345
neighbor 192.168.1.253 version 4
neighbor 192.168.1.253 next-hop-self
route-map backup-in permit 10
set local-preference 90
!
route-map backup-out permit 10
match ip address prefix-list aggregate
set metric 10
!
route-map backup-out permit 20
!
ip prefix-list aggregate seq 5 permit 10.10.10.0/24
Switch B:
BGP routing table entry for 0.0.0.0/0, version 2
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Not advertised to any peer
1111
192.168.2.121 from 192.168.2.121 (192.168.5.142)
Origin IGP, metric 0, localpref 90, valid, external
1111
192.168.1.253 from 192.168.1.253 (192.168.5.249)
Origin IGP, metric 0, localpref 100, valid, internal, best