8-1 Manually Configuring Routes

  • Static routes can be manually defined for an IP network.

  • Static routes should be defined if a dynamic routing protocol cannot be used or cannot build a route to a destination network.

  • Static routes have a default administrative distance of 0 if defined to an interface and 1 if defined to a next hop.

  • Static routes can be specified with an administrative distance as floating static routes.

  • All unroutable packets can be sent to a default route, also called a gateway of last resort.

  • Default routes can be static in nature or configured with the default-route command and can be redistributed into routing protocols.

  • Default routes can be originated by a dynamic routing protocol.

Configuration

  1. (Optional) Define a static route:

     (global)  ip route   network mask  {  next-hop-addr   interface  } [  distance  ]   [  tag   tag  ] [  permanent  ] 

    A static route to the IP network defined by network and mask is added to the routing table. The path to the destination is defined by the IP address of the next-hop router or by the outbound interface on the local router. An administrative distance can be given with the distance field. By default, a static route has a distance of 1 and cannot be overridden by any dynamic routing protocol. Assigning a greater distance allows the static route to be defined and used until a routing protocol with a lesser distance defines the same route. The tag keyword can be used to assign a tag for conditionally redistributing the route. The permanent keyword causes the route to remain in the routing table even if the outbound interface shuts down.

    Table 8-1 shows the default values of administrative distance for each source of routing information. This table can be used to choose a value for a floating static route such that only desired routing protocols or sources can override the static route.

Table 8-1. Default Administrative Distance Values
Route Source Default Distance
Connected or static with interface specified
Static next hop 1
EIGRP summary 5
EBGP 20
Internal EIGRP 90
IGRP 100
OSPF 110
IS-IS 115
RIP 120
IBGP 200
Untrusted 255

NOTE

Static routes that point to an interface are considered directly connected. When the interface is up, these routes appear in the routing table. These routes are also advertised by dynamic routing protocols as long as the interface belongs to a network specified in the routing protocol's network command.


  1. (Optional) Define a default route.

    1. Configure a static default route:

       (global)  ip route 0.0.0.0 0.0.0.0  {  ip-address   interface  } 

      The static route 0.0.0.0 with a mask of 0.0.0.0 is a special route known as a default static. This route is used as the forwarding path if there is no entry in the routing table for the destination address of the packet.

      -OR-

    2. Configure a candidate default network:

       (global)  ip default-network   network  

      The network specified is flagged as a candidate for the default route. This command is very similar to the default static route, except that the network specified does not have to be directly connected. To be considered, the network must already appear in the routing table. One of the candidate default routes is selected based on the lowest administrative distance and the lowest metric. The gateway of last resort can be displayed with the show ip route command. The candidate default routes are flagged with a * in the output.

  2. (Optional) Clear routes from the routing table:

     (exec)  clear ip route  {  network  [  mask  ]  *} 

    Routes can be manually cleared from the routing table, if necessary, in EXEC mode. The routes defined by the network and mask combination are cleared. If the * is used, the entire routing table is cleared.

Example

A static route for 10.1.0.0 255.255.0.0 is defined such that it can be overridden by external BGP, EIGRP, and IGRP routes, but not by OSPF routes. (The default administrative distance of External BGP is 20, EIGRP is 90, IGRP is 100, and OSPF is 110.) Networks 192.168.1.0 and 192.168.22.0 are flagged as candidate default networks:

 ip route 10.1.0.0 255.255.0.0 192.168.1.1 105 ip default-network 192.168.1.0 ip default-network 192.168.22.0 


Cisco Field Manual[c] Router Configuration
Cisco Field Manual[c] Router Configuration
ISBN: 1587050242
EAN: N/A
Year: 2005
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net