12-21-2009 06:31 PM - edited 03-06-2019 09:02 AM
I would like to reach n.n.n.n over the internet with the default route in place
or with a static route when the default route is not set:
ip dhcp-client default-router distance 253
interface FastEthernet 0/0 ... internet gateway
ip address dhcp
... makes a default route like: ip route 0.0.0.0 0.0.0.0 FastEthernet 0/0 253
... now if I place:
ip route n.n.n.n 255.255.255.255 FastEthernet 0/1 e.e.e.e 254
... I suppose n.n.n.n will be reached with the default route (AD=253) if set or via the second interface (Fa0/1) if no default route is present right ?
... well; it's not working, it attempts to reach n.n.n.n via the second interface no matter whether a default route is set or not
show ip route is clearly showing both routes with proper ADs
what am I doing wrong ?
PS: what came first to mind was to use ip sla tracking for the default route to install the alternate but on second thought this seemed a simple and better solution
Solved! Go to Solution.
12-21-2009 08:50 PM
the router uses the best route (not in sens of metric but in sens of the nearest) to route your traffic.
in your case the best route is n.n.n.n 255.255.255.255 even if it has a bad metric.
the router only use 0.0.0.0 route if no better route exists
for example:
if you have this in your ip route table
ip route 10.0.0.0 255.0.0.0 int s0
ip route 10.1.0.0 255.255.0.0 int s1 50
ip route 10.1.1.0 255.255.255.0 int s2 100
if your router will route one packet with IP destination 10.1.1.5 it will use the third route (via s2) because it is the nearest and the most close to the IP address
now if you have
ip route 10.0.0.0 255.0.0.0 int s0
ip route 10.1.0.0 255.255.0.0 int s1 50
ip route 10.1.1.0 255.255.255.0 int s2 100
ip route 10.1.1.0 255.255.255.0 int s3 150
if s2 fails then it will use s3
12-21-2009 08:50 PM
the router uses the best route (not in sens of metric but in sens of the nearest) to route your traffic.
in your case the best route is n.n.n.n 255.255.255.255 even if it has a bad metric.
the router only use 0.0.0.0 route if no better route exists
for example:
if you have this in your ip route table
ip route 10.0.0.0 255.0.0.0 int s0
ip route 10.1.0.0 255.255.0.0 int s1 50
ip route 10.1.1.0 255.255.255.0 int s2 100
if your router will route one packet with IP destination 10.1.1.5 it will use the third route (via s2) because it is the nearest and the most close to the IP address
now if you have
ip route 10.0.0.0 255.0.0.0 int s0
ip route 10.1.0.0 255.255.0.0 int s1 50
ip route 10.1.1.0 255.255.255.0 int s2 100
ip route 10.1.1.0 255.255.255.0 int s3 150
if s2 fails then it will use s3
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