cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3004
Views
4
Helpful
17
Replies

Failover Using Script in BGP or static Routing

TaimurKhan
Level 1
Level 1

Hi,

our router is connected to two isp. ISP 1 and ISP2. ISP 1 is connected through microwave and ISP 2 is connected through Fiber Link(provided by some vendor)..

ISP1 gives us P2P Pingable IP.

ISP2 gives us P2P Private IP and can be only pingable from our router.

BGP is running with both ISP.

i am having default route to both ISP and there is track on these routes so in case any link goes down all traffic flows in other direction and in normal circumstances do Load balancing.

recently we faced service issue from isp2. our bgp was up with isp2 but there was upstream issue from isp2. but still my router was having bgp up with isp 2 and still it was sending traffic that way. which was causing issue for our services.

i configured track on P2P ip and at that moment as P2P ip was up so my router does not find any problem and was doing its normal work. so i asked my isp2 to give me some IP or way to monitor your services as in case something happens again so our router can track that but they refused to do so.

so i need some other way to tackle this problem if it happens in future.

note that when that issue happened i was having only bgp up with isp2 but not receiving any prefixes.

 

17 Replies 17

Screenshot (401).png
hostname R1
!
track 1 ip sla 1 reachability
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Loopback10
ip address 11.11.11.11 255.255.255.255
!
interface FastEthernet0/0
ip address 100.0.0.1 255.255.255.0
duplex full
!
interface FastEthernet1/1
ip address 200.0.0.1 255.255.255.0
speed auto
duplex auto
!
router bgp 100
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
network 11.11.11.11 mask 255.255.255.255
neighbor 100.0.0.2 remote-as 200
neighbor 200.0.0.3 remote-as 300
neighbor 200.0.0.3 route-map wieght in
neighbor 200.0.0.3 route-map 11.11.11.11 out
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip route 8.8.8.8 255.255.255.255 FastEthernet0/0 permanent <<- solution for your case in this line 
!
!
ip prefix-list 1.1.1.1 seq 10 permit 1.1.1.1/32
!
ip prefix-list 11.11.11.11 seq 10 permit 11.11.11.11/32
ip sla 1
icmp-echo 8.8.8.8 source-interface Loopback0
ip sla schedule 1 life forever start-time now
!
route-map weight permit 10
set weight 5000
!
route-map 1.1.1.1 permit 10
match ip address prefix-list 1.1.1.1
!
route-map 11.11.11.11 permit 10
match ip address prefix-list 11.11.11.11/32
!
event manager applet mhm
event track 1 state down
action 1.0 cli command "enable"
action 1.1 cli command "conf t"
action 1.2 cli command "router bgp 100"
action 1.3 cli command "no nei 100.0.0.2 remote-as 200"
action 1.4 cli command "exit"
event manager applet mhmup
event track 1 state up
action 1.0 cli command "enable"
action 1.1 cli command "conf t"
action 1.2 cli command "router bgp 100"
action 1.3 cli command "nei 100.0.0.2 remote-as 200"
action 1.4 cli command "exit"

Hi @MHM Cisco World 

Thanks for your efforts.

I am still confused in case when the services in upstream goes down then how upstream providers gonna know about my Loopbacks. As script remove neighborship with isp2 and as bgp goes down, isp2 will not receive any Loopbacks from my end. hence upstream providers will not know about my loopbacks and I believe that even when services restores in isp2 still my bgp will not come up as I am still not advertising it.

kindly clear my confusion.

thanks

You mention that LO is advertise by two ISP 
ISP1 and ISP2 
what ever the ISP we must use static route toward 8.8.8.8 using interface toward ISP2. 
now if link toward ISP2 is down the ip sla track is down, and hence Peer toward ISP2 is delete, 
still any other traffic will go through ISP1. 
thanks 
MHM