We help IT Professionals succeed at work.

IP routing table

Dragon0x40
Dragon0x40 used Ask the Experts™
on
A routing table matches route prefixes and if a match is found determines the next hop ip address.

Sometimes that next hop ip address is an ip address located on the same router?

So in addition to determining a next hop ip address you also need to determine an exit interface on that router?

Even if that exit interface is null0 the bit bucket?

I have encountered where I do a "show ip route x.x.x.x" and it shows me a next hop ip address of y.y.y.y

So I run "show ip route y.y.y.y" and it tells me directly connected via vlan z.

I have not encountered a well written explanation of how to use sh ip route to do what I am explaining above. Maybe it is assumed to be so basic that it does not need any explanation.

Could you have a situation where it takes 3 or 4 lookups in the route table before you can determine an exit interface? For example you have to sequentially look up 3 or 4 addresses before you get a next hop ip address and an exit interface?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011
Commented:
Yes, it is absolutely correct, however I dont think there are situations when you need to make 3-4 lookups to determine the exit interface. Next hop ip address is always in the first lookup if routing is configured properly and the route for the subnet exists

Author

Commented:
Do static routes make for additional lookups to find an exit interface?
Top Expert 2011

Commented:
What do you mean by additional lookups?

Author

Commented:
If a static route to x.x.x.x points to next hop ip address of y.y.y.y then you have to look up y.y.y.y to get an exit interface or vlan or maybe even another next hop ip address of z.z.z.z?

If you don't have a static route but  used a dynamic routing protocol then the route for x.x.x.x would be shown as z.z.z.z without the additional lookup of y.y.y.y?
Don JohnstonInstructor
Top Expert 2015

Commented:
>Sometimes that next hop ip address is an ip address located on the same router?

I don't believe I've ever seen this before. Do you have an example?
Top Expert 2011

Commented:
If you don't have a static route but  used a dynamic routing protocol then the route for x.x.x.x would be shown as z.z.z.z without the additional lookup of y.y.y.y?


No, the existence of the exit interface in route lookup does not depend on the type of routing (static or dynamic)
Ernie BeekSenior infrastructure engineer
Top Expert 2012

Commented:
Could you post the routing table so we can see what you're talking about?

Author

Commented:
I will try to find an example but does everyone at least agree that if I do a "show ip route x.x.x.x" I may get route via another ip address say y.y.y.y and to find out where the packet will go I have to do a "show ip route y.y.y.y" to find the exit/egress interface?

This is something that I have not seen explained very well anywhere. But maybe i am not doing something correctly.
Don JohnstonInstructor
Top Expert 2015

Commented:
>I will try to find an example but does everyone at least agree that if I do a "show ip route x.x.x.x" I may get route via another ip address say y.y.y.y and to find out where the packet will go I have to do a "show ip route y.y.y.y" to find the exit/egress interface?

I don't agree. Every route I've seen always has a next hop address that is on a directly connected network. That doesn't mean you couldn't create one, but with dynamic routing protocols, the next hop will be directly connected.

Author

Commented:
What if you have static routes?
Top Expert 2011
Commented:
@donjohnston,

He wants to say that when doing "show ip route x.x.x.x" and getting y.y.y.y as a next hop there is no egress interface specified in the output.

@Dragon0x40

If you take a look here

switch#sh ip route 192.168.33.0
Routing entry for 192.168.33.0/24
  Known via "eigrp 2008", distance 170, metric 4096, type external
  Redistributing via eigrp 2008
  Last update from 10.40.50.14 on Vlan404, 18:53:40 ago
  Routing Descriptor Blocks:
  * 10.40.50.14, from 10.40.50.14, 18:53:40 ago, via Vlan404
      Route metric is 4096, traffic share count is 1
      Total delay is 60 microseconds, minimum bandwidth is 1000000 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 5

Text in bold is the next hop with a vlan404 specified as an egress interface, it is interface vlan created on the switch. That is for dynamic routing

For static, have a look here:

switch#sh ip route 192.168.32.0
Routing entry for 192.168.32.0/24
  Known via "static", distance 1, metric 0
  Routing Descriptor Blocks:
  * 192.168.254.14
      Route metric is 0, traffic share count is 1


Ip address in bold is the next hop, there is no egress interface specified, but next hop address means that subnet 192.168.254.0 is shared between the switch and the next hop device.
Don JohnstonInstructor
Top Expert 2015
Commented:
On reviewing the posts, it looks like we're talking about recursive routes. My apologies. I thought we were dealing with a more... simple scenario. :-o

It's possible that a number of lookup operations could be done to determine a true next-hop address. I don't know of a limiting factor. But in a typical recursive routing scenario only one (additional) lookup would be done to determine the next hop address/exit interface.

Author

Commented:
switch#sh ip route 192.168.32.0
Routing entry for 192.168.32.0/24
  Known via "static", distance 1, metric 0
  Routing Descriptor Blocks:
  * 192.168.254.14
      Route metric is 0, traffic share count is 1

So if you run "sh ip route 192.168.254.14" then you will get an egress interface hopefully a connected route?
Top Expert 2011

Commented:
Yes, you are correct

Author

Commented:
I think we are talking about recursive lookups not recursive routing. From what I read on the web.

https://learningnetwork.cisco.com/thread/11843 

I would like a basic article on how to use a Routing table along with recursive lookp and how to determine what interfaces the router will send a prefix out of?