How a router know where to send a packet with the exit interface route command?












3















When configuring a Cisco router, a static route can be added using the following commands:




  • ip route 192.0.2.128 255.255.255.128 192.0.2.48

  • ip route 192.0.2.128 255.255.255.128 f0/0


If I use the second option, how does R1 know who's the next host and therefore which MAC address it should use as the destination when it wants to reach the 192.0.2.0/25 network? With a /30 network it's easy to assume that the next hop is the only remaining address in the subnet but with a larger subnet like in the example below, I don't get how this works.



network topology with two routers R1 & R2 sharing a /25 network, and R2 with another /25 network










share|improve this question





























    3















    When configuring a Cisco router, a static route can be added using the following commands:




    • ip route 192.0.2.128 255.255.255.128 192.0.2.48

    • ip route 192.0.2.128 255.255.255.128 f0/0


    If I use the second option, how does R1 know who's the next host and therefore which MAC address it should use as the destination when it wants to reach the 192.0.2.0/25 network? With a /30 network it's easy to assume that the next hop is the only remaining address in the subnet but with a larger subnet like in the example below, I don't get how this works.



    network topology with two routers R1 & R2 sharing a /25 network, and R2 with another /25 network










    share|improve this question



























      3












      3








      3








      When configuring a Cisco router, a static route can be added using the following commands:




      • ip route 192.0.2.128 255.255.255.128 192.0.2.48

      • ip route 192.0.2.128 255.255.255.128 f0/0


      If I use the second option, how does R1 know who's the next host and therefore which MAC address it should use as the destination when it wants to reach the 192.0.2.0/25 network? With a /30 network it's easy to assume that the next hop is the only remaining address in the subnet but with a larger subnet like in the example below, I don't get how this works.



      network topology with two routers R1 & R2 sharing a /25 network, and R2 with another /25 network










      share|improve this question
















      When configuring a Cisco router, a static route can be added using the following commands:




      • ip route 192.0.2.128 255.255.255.128 192.0.2.48

      • ip route 192.0.2.128 255.255.255.128 f0/0


      If I use the second option, how does R1 know who's the next host and therefore which MAC address it should use as the destination when it wants to reach the 192.0.2.0/25 network? With a /30 network it's easy to assume that the next hop is the only remaining address in the subnet but with a larger subnet like in the example below, I don't get how this works.



      network topology with two routers R1 & R2 sharing a /25 network, and R2 with another /25 network







      route






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 hours ago









      psmears

      24115




      24115










      asked 16 hours ago









      NakruleNakrule

      13515




      13515






















          1 Answer
          1






          active

          oldest

          votes


















          8














          The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).



          If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.



          Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.



          However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).



          In short: Don't do it that way.



          And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:



          ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>



          or - in your case



          ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48



          Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.



          However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).



          Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.





          [1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).






          share|improve this answer


























          • Thank you very much for that clear and detailed answer !

            – Nakrule
            9 hours ago











          • To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.

            – psmears
            8 hours ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "496"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fnetworkengineering.stackexchange.com%2fquestions%2f57055%2fhow-a-router-know-where-to-send-a-packet-with-the-exit-interface-route-command%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          8














          The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).



          If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.



          Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.



          However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).



          In short: Don't do it that way.



          And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:



          ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>



          or - in your case



          ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48



          Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.



          However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).



          Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.





          [1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).






          share|improve this answer


























          • Thank you very much for that clear and detailed answer !

            – Nakrule
            9 hours ago











          • To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.

            – psmears
            8 hours ago
















          8














          The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).



          If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.



          Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.



          However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).



          In short: Don't do it that way.



          And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:



          ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>



          or - in your case



          ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48



          Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.



          However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).



          Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.





          [1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).






          share|improve this answer


























          • Thank you very much for that clear and detailed answer !

            – Nakrule
            9 hours ago











          • To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.

            – psmears
            8 hours ago














          8












          8








          8







          The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).



          If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.



          Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.



          However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).



          In short: Don't do it that way.



          And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:



          ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>



          or - in your case



          ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48



          Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.



          However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).



          Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.





          [1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).






          share|improve this answer















          The second option is something to avoid. It is acceptable for point-to-point interfaces like serial or tunnel interfaces, but on broadcast media (such as Ethernet), it is "close to illegal" to use (regardless of whether the directly attached subnet is /25, /30 or /31).



          If configuring the route this way is possible at all (I seem to remember that recent IOS and IOS-XE based routers don't allow it), the router will attempt ARP resolution of the destination IP address of the packet-to-be-forwarded.



          Another (Cisco) router may respond to that request, if a) it has proxy arp enabled on the given interface [1] and b) it has a route to the actual destination.



          However, also any other system on that broadcast domain may respond to that ARP broadcast, and could "attract" the traffic to itself (and may do all sorts of interesting things with it, since it just got itself into a man-in-the-middle position for free).



          In short: Don't do it that way.



          And while we're at it: don't use the first option either (unless you're on NX-OS). A properly configured static route looks like this:



          ip route <destination network> <destination subnet mask> <egress interface> <next hop ip>



          or - in your case



          ip route 192.0.2.128 255.255.255.128 fastEthernet0/0 192.0.2.48



          Reasoning: without the egress interface, a recursive route lookup is taking place to find an egress interface towards the given next hop. Most of the time, this will be an interface into a directly attached subnet.



          However, some strange things may occur if that usually "up" interface into the next hop's (local) subnet goes down, and if the next hop's subnet is still learned via some dynamic routing protocol: then the given static route may not disappear from the routing table (and thus will continue to be redistributed into possibly present dynamic routing protocols, leading to all sorts of strange effects).



          Not so if the egress interface is given. If that goes down, the static route vanishes from the routing table, in all cases.





          [1] ceterum censeo: proxy arp should be disabled wherever one encounters it (unless it's really, really, really needed).







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 5 hours ago









          psmears

          24115




          24115










          answered 15 hours ago









          Marc 'netztier' LuethiMarc 'netztier' Luethi

          3,872420




          3,872420













          • Thank you very much for that clear and detailed answer !

            – Nakrule
            9 hours ago











          • To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.

            – psmears
            8 hours ago



















          • Thank you very much for that clear and detailed answer !

            – Nakrule
            9 hours ago











          • To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.

            – psmears
            8 hours ago

















          Thank you very much for that clear and detailed answer !

          – Nakrule
          9 hours ago





          Thank you very much for that clear and detailed answer !

          – Nakrule
          9 hours ago













          To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.

          – psmears
          8 hours ago





          To be fair, the man-in-the-middle situation you describe is always possible with ARP - it's always a broadcast followed by a race-to-reply.

          – psmears
          8 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Network Engineering Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fnetworkengineering.stackexchange.com%2fquestions%2f57055%2fhow-a-router-know-where-to-send-a-packet-with-the-exit-interface-route-command%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Усть-Каменогорск

          Халкинская богословская школа

          Высокополье (Харьковская область)