The above diagram shows the setup of my network.
Router model : 2911 with ios 15.1 (both)
R1 is my main router , all incoming and outgoing traffic will be handled by R1.
As for R2, if and only if ISP A is down and unable to connect to the internet, then R2 will take over the job. But once ISP A is back online, R2 will hand over the job back to R1.
My question in which approach to setup this failover is a better way?
I am also curious if ip sla work for this case?
HSRP (or VRRP) with help of IP SLA will do this job for you...i don't see any need for iBGP here btw if you already don't have BGP with your providers...
That's my personal opinion...
interface Serial0/0/0.1 ip routing ! Points at the interface that needs to be Prioritized interface FastEthernet0/0 description interface to LAN ip address x.x.x.x 255.255.255.0 standby 1 ip <Gateway> ! Virtual IP (IP Virtual) standby 1 priority 105 ! Higher Priority = Primary Router standby 1 preempt ! Enables the router with the highest priority to ! immediately become the active router standby 1 track 1 ! WAN SUBINTERFACE ! Router bgp <ASN> network <Gateway> mask 255.255.255.0 ! Broadcasts Gateway out the WAN through BGP
track 1 interface Serial0/0/0.1 ip routing ! Points at the interface that needs to be ! Prioritized interface FastEthernet0/0 description interface to LAN ip address x.x.x.x 255.255.255.0 standby 1 ip <Gateway> ! Virtual IP standby 1 priority 100 ! Lower Priority = Backup Router standby 1 preempt ! Enables the router with the highest priority to ! immediately become the active router standby 1 track 1 ! WAN SUBINTERFACE ! Router bgp <ASN> network <Gateway> mask 255.255.255.0 ! Broadcasts Gateway out the WAN through BGP
By doing the following to my 2 router is that enough? to have the automatic failover if ISP A went down routing will go thur R2?
when ISP A is up routing will go back to R1
For HSRP part you need to decrement priority in case link to ISP goes down (ie track goes down...)
I think you need better track config - use IP SLA with ICMP echo (ping) for testing if link is live.
Yea I checked on cisco.com - if you stay with your config by default its going to decrement priority by 10 so its gonna a work
For IP SLA I think ping is better option...
Your standby 1 track 1 command will help you decrement the priority of HSRP in the event of failure. The priority set on your router is fine, default decrement value for priority is 10. So....
ip sla 1
#### We want to make sure full internet connectivity by ping 184.108.40.206 from WAN below. ####
icmp-echo 220.127.116.11 source-interface <your WAN interface>
ip sla schedule 1 forever start-time now
track 1 ip sla 1 reachability
The rest of the config you already have complete.
Hope this helps
Only applies to R1 right? Why? because that is your main link attached. If that fails you don't need any sla to track router 2's link since its being used.
When R1's link fails you want it to decrement HSRP priority. R2 will never need to decrement its priority, since depending on R1's internet reachability status out to 18.104.22.168 will either be active or standby.
Hope this explains why.
When R1 comes back and has reachability, then R1 will become the HSRP active gateway and will forward traffic. R2 "won't go down" - nothing will happen with R2 apart from, will become HSRP secondary instead of primary.
So when R1 comes back R1 will be used, when R1 fails then R2 will be used.
Please read this for reference: