or exitinterface] [administrative_distance] [permanent]
This list describes each command in the string:
ip route: The command used to create the static route.
destination network: The network you’re placing in the routing table.
mask: The subnet mask being used on the network.
next-hop address: The address of the next-hop router that will receive the packet and forward it to the remote network. This is a router interface that’s on a directly connected network. You must be able to ping the router interface before you add the route.
exit interface: You can use it in place of the next-hop address if you want, but it’s got to be on a point-to-point link, like a WAN. This command won’t work on a LAN (i.e. Ethernet).
administrative distance: By default, static routes have an Administrative Distance of 1 (except when using exit interface which will have an Administrative Distance of 0, same as a connected interface). You can change the default value by adding an administrative weight at the end of the command.
permanent: If the interface is shut down, or the router can’t communicate to the next-hop router, the route will automatically be discarded from the routing table. Choosing the permanent option keeps the entry in the routing table no matter what happens.
Cisco CCNA Static Route Example
This slide shows an example of a simple static route command.
The first static route will have an Administrative Distance of 1 while the second will have an Administrative Distance of 0. Why?
Answer, static routes pointing to a next hop IP address have an administrative Distance of 1 while static routes pointing to an interface have an Administrative Distance of 0.
Note: Static routes are useful in a very small, stub network or dial on demand configurations. They should not be used in large networks or even small networks that are prone to changes.
Cisco CCNA Default Routes
We use default routing to send packets with a remote destination network not in the routing table to the next-hop router. It is a good idea to always place a default route so that you don’t have any black holes in your routing. You can only use default routing on stub networks—those with only one exit port out of the network so that you don’t have to run a routing protocol on the router.
Remember, routers look for the longest match of the destination IP address in the routing table starting with 32 bits and working backward. If no matching route is found, a default route is installed is used and the packet is forwarded to the next-hop specified in the default route. If no default route is configured and there is not a match in the routing table the packet is dropped.
Cisco CCNA Default Route Example
This slide shows three examples of defining a default route. All accomplish the exact same thing…
Note: The “ip default-gateway” command is utilized on layer 2 switches when an IP address is configured on the switch for management purposes. This allows the switch to be accessible from nodes on remote networks.
The “ip route 0.0.0.0 0.0.0.0 172.16.3.2” has an Administrative Distance of 1.
The “ip route 0.0.0.0 0.0.0.0 s0/0” has an Administrative Distance of 0 just as a connected interface.
What is the main difference between the two default routes above?
Answer: The Administrative Distance. The AD of the first default route will be 1 while the AD of the second default route will be 0.
Administrative Distance (AD) defines the reliability of a routing protocol. It is used by Cisco routers when there are two or more routes to the same destination from two different routing protocols. When this happens, the route with the lower AD is utilized.
Cisco CCNA Routing Loops
Be careful not to create routing loops as they create black holes. In the example on the slide the routing loop is created via default routes. In operational networks routing loops are typically created by redistributing one routing protocol into another.
Cisco CCNA Larger Static Route Example
This slide shows an example of using both static and default routing on a network with four routers. Every router would need to have the routing tables built. As you can see even in this simple network with 4 routers, numerous routes would need to be configured on the network. Expanding this from 4 to 40 routers you can see that static routes do not scale, nor do they account for dynamic changes on the network.
Cisco CCNA Static Route Question
Next hop 192.168.1.1
Next hop 192.168.2.2
Next hop 192.168.3.3