|
|
This section sets a default IP router and permits the definition of multiple static routes. Static routes provide IP routing information to the device when the device has not been able to determine the correct route for an IP packet using dynamic routing information. The device may also be configured to redistribute a static route via RIP or OSPF.
edit config IP StaticIn cases where the routing metrics (the number of routing hops to a destination) are equal between a static route and a dynamic route, Cisco Systems devices will use the dynamic route.
![]() |
Note Static routes are more difficult to maintain and are generally not as reliable as dynamically determined routes. We recommend that you use static routing only when the network does not provide adequate routing information through RIP or OSPF. |
After entering the edit config command, and then the append command, enter one or more routes using the following syntax:
Destination Mask {Gateway | Port} Metric [Redist = RIP | OSPF1 | OSPF2 | none]
Destination | The IP address for the destination network. It is usually entered in the standard dotted-decimal notation for IP addresses. However, values can be entered in hexadecimal as well. Hexadecimal numbers must either be preceded by a "0x" or they must be complete (8 hexadecimal digits, e.g., C6290C00 for 198.41.12.0). If 0.0.0.0 is specified as the Destination, then the route being added is to a default router. The Mask must also be 0.0.0.0. The default router will be used to route packets when the destination network is not known by the device. The "default router" is used as a "route of last resort" when your device cannot determine where an IP packet should be sent. In very simple routing setups, including connecting small networks to the Internet through an Internet Service Provider, a default router entry may be the only routing information required. |
Mask | The subnet mask for the Destination address. |
Gateway | The address on the upstream router. |
Port | The port name {VPN VPN_port_number | WAN slot:port[.subinterface]} for a VPN LAN-to-LAN connection or for a PPP link where you do not need to specify the other end's IP address. |
Metric | A value between 1 and 15 that specifies the distance or cost to the destination address. A route with a lower metric supercedes a competing route, for example one learned through a routing protocol. The metric loosely corresponds with the number of hops to the destination. You can artificially inflate or deflate the cost for a route. For example, if there is more than one route to a destination, but the route with the shortest number of hops is over a slow WAN link, you can add a non-WAN route with a deflated metric to supercede the slow WAN route. |
Redist | Indicates whether a static route should be redistributed using a routing protocol, enabling other routers to use the concentrator as the gateway for packets with the static route's destination address.
|
The first example adds a default route which passes all packets with unknown destinations to WAN 0:0. This route might be used on a device which has a connection to an Internet Service Provider via PPP through serial interface WAN 0:0.
[ IP Static ] 0.0.0.0 0.0.0.0 Wan 0:0 1
The next example adds a route to network 198.41.13.0 through the gateway 198.41.9.65. Notice that the metric is 4. That means that if a better dynamic route is found (the metric is less than or equal to 4), this route will not be used. The command also tells the device to include this route in its RIP broadcast.
[ IP Static ] 198.41.13.0 255.255.255.0 198.41.9.65 4 Redist=RIP
| Command | Description |
|---|---|
configure Frame Relay | Configures Frame Relay parameters for an interface |
configure IP | Configures IP parameters for an interface |
edit config IP Route Filter | Creates IP route filters |
show IP | Shows IP configuration and statistics |
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Wed Sep 27 10:59:16 PDT 2000
Copyright 1989-2000©Cisco Systems Inc.