Static Routes

Static routes are routes you assign in the router configuration. These routes don’t change until you reconfigure them yourself. You might ask, “Why not just use static routes and forget all this routing stuff?” Well, if all you had were static routes and something changed—perhaps you had to add another subnet, or you changed your Internet service provider—you would have to reconfigure every router to conform to the network changes. It would be impossible to react to short-term changes, such as equipment failures, in all but the simplest networks.

Static routes do have their place in a modern network. They are appropriate for default routes, routes to the null interface, routes to stub networks, and other situations in which the possibility of change is minimal.

To define a static route to network 192.168.11.0 via the router 192.168.5.1, you would use the command:

ip route 192.168.11.0 255.255.255.0 192.168.5.1

Default Static Routes

Static routes are commonly used for the default route. A default route is used when a router does not have a specific route to a certain address. The Internet gateway is always a good default route. For example, if our gateway router’s IP address is 192.168.2.1, our default route might look like this:

ip route 0.0.0.0 0.0.0.0 192.168.2.1

On the gateway router, the static route could point to the interface that is connected to the Internet:

ip route 0.0.0.0 0.0.0.0 serial 0

The 0.0.0.0 0.0.0.0 route establishes a default only for the current router ...

Get CISCO IOS in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.