03-13-2016 12:04 PM - edited 03-08-2019 04:56 AM
hi,
something like: ip route 192.168.7.0 255.255.255.0 GigabitEthernet1 10.0.0.1
what is the use of it !?
also will it differ if it was like ip route 192.168.7.0 255.255.255.0 10.0.0.1 GigabitEthernet1
thanks,
03-13-2016 12:32 PM
Hi,
Here you find a nice explanation: https://supportforums.cisco.com/document/116711/static-routes-next-hop-exit-interface-or-ip-address
Kind regards
03-13-2016 08:24 PM
The article in the link that Robenneke gives is about the difference in a static route which specifies the next hop address or a static routes which specifies the outbound interface. But it does not discuss the situation in which a static route specifies both the outbound interface and the next hop address. And this is what the original poster is asking.
The original poster asks what is the use of it to specify both the next hop address and the outbound interface. Let me try to explain it in this way:
The article in the link that Robenneke gives provides a pretty good explanation of the advantage of specifying the next hop address if the outbound interface is an Ethernet type of interface. So in the example given by the original poster we need to specify the next hop of 10.0.0.1. But what if 10.0.0.1 is not a directly connected address. Then IOS will do a recursive lookup to find how to get to that address. Perhaps it turns out that 10.0.0.1 can be reached using Gig1 which supplies encryption of traffic going out that interface and that it is also reached using Serial2 which does not encrypt its traffic. If it is important that traffic to 192.168.7.0 be encrypted then it is important to specify that it use Gig1 and not Serial2. What is what we achieve when we specify both the outbound interface and the next hop address.
HTH
Rick
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