04-29-2021 06:58 AM
Hi,
I am trying to configure primary and secondary route with pref 1 and 2.
The objective is to always use primary route gateway 10.1.1.1. and Only use secondary gateway 10.1.1.2 if primary is down.
On top of tht, I also have a default route 0.0.0.0/0 for all other traffic.
ip route 0.0.0.0/0 Vlan50 10.1.1.1
ip route 0.0.0.0/0 Vlan50 10.1.1.2
1)May I know is the config correct? Do i need this CLI--->ip route 172.30.1.10/32 Vlan50 10.1.1.2 2
Or the def ip route --->ip route 0.0.0.0/0 Vlan50 10.1.1.2 already does the job?
2)Also does the switch still forward the traffic to both gateway if either gateway is down?
ip route 0.0.0.0/0 Vlan50 10.1.1.1
ip route 0.0.0.0/0 Vlan50 10.1.1.2
CX34765E# sh ip route 172.30.1.10
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
172.30.1.10/32, ubest/mbest: 1/0
*via 10.1.1.1, Vlan50, [1/0], 00:28:08, static
via 10.1.1.2, Vlan50, [2/0], 00:07:14, static
04-29-2021 10:03 AM - edited 04-29-2021 10:55 AM
Hi,
Yes, if you want the first route to be used as a primary and the other one as a secondary, you need to use this syntax:
ip route 0.0.0.0/0 Vlan50 10.1.1.1
ip route 0.0.0.0/0 Vlan50 10.1.1.2 2
But in this scenario, the first route will never disappear as long as vlan50 remains up and the second routes will not be installed, even though the first next hop is not reachable. So the best approach would be to use ip sla to monitor the primary routes and to declare it down if its doesn't respond. It would look something like this:
track 1 ip sla 1
!
ip sla 1
icmp-echo 10.1.1.1
frequency 5
ip sla schedule 1 life forever start-time now
!
ip route 0.0.0.0/0 Vlan50 10.1.1.1 track 1
ip route 0.0.0.0/0 Vlan50 10.1.1.2 2
!
Regards,
04-29-2021 10:13 AM
Hi,
Thanks for yr great tips.
For config below, Will the switch still send traffic to 10.1.1.1 when 10.1.1.1 is down?
ip route 0.0.0.0/0 Vlan50 10.1.1.1
ip route 0.0.0.0/0 Vlan50 10.1.1.2
If yes, Normally how to fix this kind of issue esp when 10.1.1.1 or 10.1.1.2 is down? This is to ensure traffic not effected and switch sending traffic to the right gateway.
04-29-2021 10:43 AM - edited 04-29-2021 10:58 AM
Yes, if you configure the two static routes with equal admin metric, both will be used equally and traffic would be load balanced between 10.1.1.1 and 10.1.1.2 even though 10.1.1.1 is down. The way to fix it would be to assign a lower metric to the primary static route and to monitor it using ip sla as I recommended previously.
The other way would be to run HSRP on 10.1.1.1 and 10.1.1.2. You would then replace the two static routes with only one static route that would use the HSRP virtual address as the next hop.
Regards,
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide