Static routing and next hop addresses

Met44Met44 Member Posts: 194
An odd question came up to me while reading through some of the Cisco Network Academy curriculum, which I have spent a few days trying to figure out.

If you supply the exit interface in the ip route command, along with the IP address, what does the router use the IP address for? Does it tell the router which ip address to look up in the ARP cache (in the case of a multiaccess network like Ethernet, where there may be more than one router in a broadcast domain)?

In addition to this, according to the Cisco Network Academy text, the IP address specified does not have to be that of the next hop router, only that it be resolvable within the routing table (though it is commonly referred to as the "next hop IP address"). This is all they say on the subject. So, the router couldn't really rely on this information to find the correct next hop MAC address on the local link... the IP address specified could be remote.

So, it appears to me that the router could not use the ip address to find the next hop router. However, this would bring up another issue if multiple routers were connected to the same switch; the router needs to get the destination MAC address from somewhere.

What purpose does the IP address specification serve when you supply the exit interface (beyond changing the AD)? In what circumstance would it be beneficial to use an ip address of something other than the next hop router in the ip route command?

If anyone can provide some insight for me or direct me to a resource that provides this information, that would be excellent. So far, I haven't been able to find one.

I appreciate any responses, thank you.

Comments

  • tech-airmantech-airman Member Posts: 953
    Met44,
    Met44 wrote:
    An odd question came up to me while reading through some of the Cisco Network Academy curriculum, which I have spent a few days trying to figure out.

    Which CCNA curriculum (CCNA Exploration or CCNA Discovery), CCNA curriculum level (Semester 1, Semester 2, Semester 3, or Semester 4) and module are you talking about?
    Met44 wrote:
    If you supply the exit interface in the ip route command, along with the IP address, what does the router use the IP address for? Does it tell the router which ip address to look up in the ARP cache (in the case of a multiaccess network like Ethernet, where there may be more than one router in a broadcast domain)?

    In addition to this, according to the Cisco Network Academy text, the IP address specified does not have to be that of the next hop router, only that it be resolvable within the routing table (though it is commonly referred to as the "next hop IP address"). This is all they say on the subject. So, the router couldn't really rely on this information to find the correct next hop MAC address on the local link... the IP address specified could be remote.

    So, it appears to me that the router could not use the ip address to find the next hop router. However, this would bring up another issue if multiple routers were connected to the same switch; the router needs to get the destination MAC address from somewhere.

    What purpose does the IP address specification serve when you supply the exit interface (beyond changing the AD)? In what circumstance would it be beneficial to use an ip address of something other than the next hop router in the ip route command?

    If anyone can provide some insight for me or direct me to a resource that provides this information, that would be excellent. So far, I haven't been able to find one.

    I appreciate any responses, thank you.
  • SlowhandSlowhand Mod Posts: 5,161 Mod
    Well, let's take a look at the command, itself.
    router(config)# ip route <IP/Network> <NETMASK> <NEXT HOP ROUTER/Interface>
    

    You're first giving the IP address and netmask of [the destination network]* then giving a destination [path]*. This destination is going to be either the outgoing interface or the IP address of the next-hop router. This article also explains static routing.

    *[Edited for content. Poster was sober during the initial explanation, a mistake that will be ratified ASAP.]

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Met44Met44 Member Posts: 194
    tech-airman,

    I was reading Cisco Exploration version 4.0 (the new one), Intro to Routing, Chapter 2.1.4.2.

    I'll read through your link today Slowhand and post back later.
  • tech-airmantech-airman Member Posts: 953
    Slowhand wrote:
    Well, let's take a look at the command, itself.
    router(config)# ip route <IP/Network> <NETMASK> <NEXT HOP ROUTER/Interface>
    

    You're first giving the IP address and netmask of a local interface on the router, (you're going to want this to be the interface that traffic is coming in from and needs to be routed from icon_wink.gif ,) then giving a destination. This destination is going to be either the outgoing interface or the IP address of the next-hop router. This article also explains static routing.

    Slowhand,

    If you "...first giving the IP address and netmask of a local interface on the router..." then by using the router(config)#ip route command, you just taught the router how to reach it's own interface. Due to the Connected nature of the "...local interface on the router..." it doesn't need to be taught or configured how to reach it's own interface. So what the "<IP/Network> <NETMASK>" part of the "ip route" command is specifying the _destination_ network/subnetwork/host. You have to specify the destination network/subnetwork/host address in the routing table because static routing has no way to dynamically update the routing table for other network/subnetwork/hosts. As you know, if the destination network/subnetwork/host is not found in the routing table and there is no default route, the packet gets dropped.
  • SlowhandSlowhand Mod Posts: 5,161 Mod
    Slowhand wrote:
    Well, let's take a look at the command, itself.
    router(config)# ip route <IP/Network> <NETMASK> <NEXT HOP ROUTER/Interface>
    

    You're first giving the IP address and netmask of a local interface on the router, (you're going to want this to be the interface that traffic is coming in from and needs to be routed from icon_wink.gif ,) then giving a destination. This destination is going to be either the outgoing interface or the IP address of the next-hop router. This article also explains static routing.

    Slowhand,

    If you "...first giving the IP address and netmask of a local interface on the router..." then by using the router(config)#ip route command, you just taught the router how to reach it's own interface. Due to the Connected nature of the "...local interface on the router..." it doesn't need to be taught or configured how to reach it's own interface. So what the "<IP/Network> <NETMASK>" part of the "ip route" command is specifying the _destination_ network/subnetwork/host. You have to specify the destination network/subnetwork/host address in the routing table because static routing has no way to dynamically update the routing table for other network/subnetwork/hosts. As you know, if the destination network/subnetwork/host is not found in the routing table and there is no default route, the packet gets dropped.

    You're absolutely right. It's been a long night/morning for me, I really should stop trying to post answers when I'm half-dead. icon_lol.gif

    As tech-airman pointed out, you're giving the destination network address/subnet mask and then an outgoing interface or next-hop to reach it by.

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Met44Met44 Member Posts: 194
    I was reading Cisco Exploration version 4.0 (the new one), Intro to Routing, Chapter 2.1.4.2.

    Woops, that's Semester 2, by the way. Chapter 2 is called "Static Routing".
  • dtlokeedtlokee Member Posts: 2,378 ■■■■□□□□□□
    Don't use an exit interface on a multiaccess media like Ethernet because this will rely on proxy arp to find the next hop. Using an exit interface is really only useful on point to point connections like PPP or HDLC encapsulated serial interfaces or point to point frame realy subinterfaces. One benefit of using an exit interface is the static routes will show up in the routing table with an AD of 0 and are then eleigable to be advertised via a network command under the routing process.

    If you use a next hop IP address that is not directly connected it will need to do a recursive lookup to find the next hop in the routing table. Again this is something you can do but not a good design choice.
    The only easy day was yesterday!
  • PashPash Member Posts: 1,600 ■■■■■□□□□□
    dtlokee wrote:
    Don't use an exit interface on a multiaccess media like Ethernet because this will rely on proxy arp to find the next hop. Using an exit interface is really only useful on point to point connections like PPP or HDLC encapsulated serial interfaces or point to point frame realy subinterfaces. One benefit of using an exit interface is the static routes will show up in the routing table with an AD of 0 and are then eleigable to be advertised via a network command under the routing process.

    If you use a next hop IP address that is not directly connected it will need to do a recursive lookup to find the next hop in the routing table. Again this is something you can do but not a good design choice.

    Thats such a good piece of advice, never really thought about that much in real world implementation because most installations I have done have an ISP configured router on the edge anyway, so thats always the next hop. Great stuff..cheers DT.
    DevOps Engineer and Security Champion. https://blog.pash.by - I am trying to find my writing style, so please bear with me.
  • Met44Met44 Member Posts: 194
    Excellent detailed information dtlokee.

    Thanks all for the replies.
Sign In or Register to comment.