0

On our HP and Cisco devices, we had two static routes:

0.0.0.0/0  gateway  10.10.10.1

and

10.10.90.0/24  gateway  10.10.90.1

...both with a metric of 1.

I went to send some traffic to 10.10.90.x (from a not-mentioned subnet) and the layer 3 switch with these two static routes of course would pick either one since the metric is equal. Of course it happened to pick the 0.0.0.0/0 match which caused connection troubles.

I updated the metric on the 0.0.0.0/0 (internet at 10.10.10.1) to be a higher metric, as I expect many do and was an error on our part.

However, the switch continued to forward all traffic to that path.

What is the command to view/reset route selections? I wanted the switch to re-check routes.

more info:

"show ip route" indeed works and shows the routes.

My curiosity is; say that I changed that route table. How do I get the switch to check these routes again? Should it automatically?

Say I had a packet destined to 10.10.10.5

These two routes were available:

0.0.0.0/0  gateway  192.168.1.1 metric 1  -and-
10.10.10.0/24  gateway  192.168.50.50 metric 1

... and the switch was sending that "10.10.10.5"-bound packet via the 192.169.50.50 gateway. However, say I changed that route to have a metric of 2. I would now expect that "10.10.10.5"-bound packet to be routed 192.168.1.1, correct? Since it has the lower metric? However, my switch never makes that change until power cycled or I pull cables for a few seconds. It's not, what I am calling, "re-evaluating" the route table.

  • 1
    Metric only comes into play when you have two different routes for the exact same network/mask. A more specific route will always be preferred over a less specific route. So in your examples, a /24 route will always be chosen over the /0 or default route. You must have some other problem on your network that is creating your problems and the information provide is not enough to give an answer currently. – YLearn Nov 20 '14 at 22:45
  • 1
    How are you using 10.10.90.1 as the gateway for the 10.10.90.0/24 subnet? The routing device has to have a route to the gateway for it to be able to send traffic a different direction. Otherwise the 10.10.90.1 address is looked up in the routing table and then follows the default route, causing it to look like it 'load-balances' by metric. – cpt_fink Nov 21 '14 at 2:27
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 10 '17 at 23:19
  • Where you said "ip show route", did you mean "ip route show"? The former doesn't work in any of the Mac or Linux boxes I'm familiar with. – Marnix A. van Ammers Mar 3 at 20:17
3

If I understand your post correctly you're making one fundamental mistake here: more specific routes are always preferred over less specific routes. So the route for 10.10.90.0/24 gateway 10.10.90.1 always is preferred over 10.10.10.1.

You didn't mention which type of Cisco and HP equipment and software versions you're using, but on most Cisco's you can view the routing table using the show ip route command.

  • I added more information starting at "more info" to my post, if you could assist. – user10411 Nov 20 '14 at 21:43
  • 3
    Metrics don't have any effect if there's a more specific route, as I said earlier. More specific routes are always preferred, so if the /24 route matches, that gateway will always be selected, not the default gateway. – Teun Vink Nov 20 '14 at 21:49
  • This is a configuration issue, not a routing decision issue... 10.10.90.1 is included in 10.10.90.0/24... – cpt_fink Nov 21 '14 at 2:49
  • I understand what you're saying and accept it as truth. Any idea why the switch was choosing the 0.0.0.0/0 route however? The more specific route existed. Perhaps just a glitch? – user10411 Nov 21 '14 at 15:46
  • @user10411 Most possible cause is unreachability of 10.10.90.1. It must lie in local network. Or 10.10.90.1 is address of switch itself? (some systems show interface routes in such way) – mmv-ru Nov 21 '14 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.