I ran into a siutation where I had to create a static route based on the source. I enabled ip source route but I'm not sure how this should be entered into the router.
i.e I need two static routes for;
Any traffic to 0.0.0.0 from 10.0.0.0/8 to be routed to A
Any traffic to 192.0.0.0 from 10.0.0.0/8 to be routed to B
Thank you in advance for your prompt response.
you need to use Policy Based Routing to achieve this:
ip access-list 11 permit 10.0.0.0 0.255.255.255
ip access-list 111 permit ip 10.0.0.0 0.255.255.255 192.168.0.0 0.0.255.255
route-map pbr_net10 permit 10
match ip address 111
set ip next-hop B
route-map pbr_net10 permit 20
match ip address 11
set ip next-hop A
then you need to apply this on the interface(s) that receive the traffic to be policy routed
ip policy route-map pbr_net10
PBR is supported also on multilayer switch.
Additional tuning can be provided by next-hop verify-availability but this is not supported in all platforms
you still need one or more default static routes pointing to next-hops:
ip route 0.0.0.0 0.0.0.0 next-hop-A
eventually if needed
ip route 0.0.0.0 0.0.0.0 netxt-hop-B
Hope to help