7-4 Open Shortest Path First (OSPF)


  • OSPF is a link-state routing protocol that uses a cost metric that is computed using the links' bandwidth.

  • OSPF is a vendor-independent protocol defined by RFC 2328.

  • OSPF uses multicast advertisements to communicate changes in the routing topology.

  • OSPF is a classless routing protocol that supports VLSM.

  • The hierarchical routing protocol supports areas to control the distribution of routing updates.

  • OSPF supports routing summarization between areas to minimize routing table entries.

NOTE

OSPF uses IP protocol 89 to communicate and uses the multicast address of 224.0.0.5 to send updates to all OSPF routers. OSPF uses the multicast address of 224.0.0.6 to send updates to OSPF-designated routers.


Configuration

  1. (Optional recommended) Configure loopback to set the OSPF router ID:

     (global)  interface loopback 0  (interface)  ip address   ip-address subnet mask  

    All OSPF routers identify themselves and their link-state announcements. Cisco routers use the highest loopback address if one is configured; otherwise , they use the highest IP address on the active interfaces. By setting the loopback address, you control what the router ID will be. This should be done before the OSPF process is enabled.

  2. Enable the OSPF process:

     (global)  router ospf   process-id  

    This places the device in router configuration mode. The process ID is router-independent and is used to identify a particular instance of OSPF for the router.

  3. Activate OSPF for a network, and associate that network with an area:

     (router)  network   network-number wildcard-mask   area   area-id  

    The network command enables the OSPF process on any interface that falls within the range specified by the wildcard mask. For example, 172.16.0.0 with a mask of 0.0.255.255 would enable OSPF on any interface that was assigned an address where the first two octets were 172.16.

    The area-id assigns those networks to an OSPF area. The area-id can be defined as a decimal area (0 to 4294967295) or as four octets written in IP address format. IP address format can be useful if you are correlating IP subnets to OSPF areas. In any event, the area-id is a 32-bit quantity that can be written in either of the two formats. For example, area 5 can also be written as area 0.0.0.5.

    NOTE

    An OSPF network must have a backbone area, defined by routers with an OSPF area of 0 or 0.0.0.0.

  4. (Optional) Configure stub area:

     (router)  area   area-id   stub  [  no-summary  ] 

    Specifies the stub flag for an area. If an area is defined as a stub, all routers in the area must have the stub flag set. Using the no-summary option for the ABR creates a totally stubby area that prevents the introduction of any external or interarea routes into the configured area.

  5. (Optional) Set the cost of the default route generated in a stub area:

     (router)  area   area-id   default-cost   cost  

    If you set a stub area or totally stubby area, area routers are sent a default route in place of any external or interarea routes. This command sets the default cost for those default routes.

  6. (Optional) Configure a not-so-stubby area (NSSA):

     (router)  area   area-id   nssa  [  no-redistribution  ]   [  default-information-originate  ] 

    Setting an NSSA allows the transport of external routes through a stub area. The no-redistribution option is used on an ABR when you want the external routes to be redistributed only into normal areas and not into any NSSAs. The default-information-originate option is used on an Area Border Router (ABR) to generate a default route into the NSSA.

  7. (Optional) Configure a virtual link to provide backbone connectivity:

     (router)  area   area-id   virtual-link   router-id  [  hello-interval   seconds  ]   [  retransmit-interval   seconds  ] [  transmit-delay   seconds  ] [  dead-interval   seconds  ] [[  authentication-key   key  ] [  message-digest-key   keyid   md5   key  ]] 

    The virtual link is an extension of the backbone. It provides connectivity for the backbone for discontiguous areas. The area-id is that of the transit areathe area that must be crossed to reach the backbone. The router-id is that of the complementary router that will form the virtual link.

    NOTE

    The virtual-link command must be configured on each device that forms the connection from a remote area to the backbone (area 0 or 0.0.0.0). Because this is an extension of the backbone, any authentication parameters or timers must also be set for the virtual link.

  8. (Optional) Summarize routes between areas:

     (router)  area   area-id   range   summary-address mask  

    This command allows an ABR to reduce the number of routes it sends into the specified area by sending the summary address in place of any route that falls within the range specified by the mask.

  9. (Optional) Set the OSPF interface priority:

     (interface)  ip ospf priority   number  

    This can be from 0 to 255; the default is 1. It is used to choose the Designated Router (DR) and Backup Designated Router (BDR) on broadcast-type networks. A priority of 0 indicates that the router cannot be a DR or BDR for the broadcast network.

    NOTE

    Beware of making the OSPF priority 0 on all routers connected to a broadcast domain. If all of them are priority 0, none of them will be able to form adjacencies. Also, there will be no elected DR.

    1. (Optional) Set the hello interval:

       (interface)  ip ospf hello-interval   seconds  

      This specifies the number of seconds between hello updates (the default is 10 seconds). The hello interval must match between neighbor devices in order for the routers to form an adjacency .

    2. (Optional) Set the dead interval:

       (interface)  ip ospf dead-interval   seconds  

      This specifies the number of seconds after which no hello updates are received before the neighbor is declared down (the default is four times the hello interval). The dead interval must match between neighbor devices in order for the routers to form an adjacency.

    3. (Optional) Set the retransmit interval:

       (interface)  ip ospf retransmit-interval   seconds  

      This specifies the number of seconds between link-state advertisement retransmissions for a neighbor out the OSPF interface (the default is 5 seconds).

    4. (Optional) Set the transmit delay:

       (interface)  ip ospf transmit-delay   seconds  

      This specifies the number of seconds it takes to transmit a link-state update packet on an OSPF interface (the default is 1 second).

  10. (Optional) Configure interface parameters.

    1. Set the interface cost:

       (interface)  ip ospf cost  

      This manually sets the unitless cost of the interface (1 to 65535). This is useful when connecting to a device that does not compute cost in the same way as the Cisco router. OSPF cost is computed as 10 8 divided by the interface bandwidth, given by the bandwidth command. Default interface costs are then 56 kbps (1785), 64 kbps (1562), T1 (65), E1 (48), 4 Mbps Token Ring (25), Ethernet (10), 16 Mbps Token Ring (6), FDDI (1), ATM (1), Fast Ethernet (1), and Gigabit Ethernet (1).

    2. Set the reference bandwidth:

       (router)  auto-cost reference-bandwidth   ref-bw  

      OSPF cost is calculated by dividing the interface bandwidth by the ref-bw (1 to 4294967 Mbps; the default is 100). The default ref-bw is 10 8 , or 100 Mbps, which means that a Fast Ethernet and Gigabit Ethernet link have the same cost of 1. This command allows for differentiation between the high-bandwidth links. For example, if the ref-bw is set to 1000, Fast Ethernet (100 Mbps) would have a cost of 1000/100, or 10, and Gigabit Ethernet would be 1000/1000, or 1.

      WARNING

      You should choose a reference bandwidth value that is just high enough to differentiate your highest-speed interfaces. Choosing a ref-bw value that is too high will result in an interface cost that looks unreachable. For example, with a reference bandwidth of 5000 Mbps (5000000000 bps) and an interface bandwidth of 64 kbps (64000 bps), the resulting cost would be 5000000000/64000, or 78125a value that is greater than the maximum OSPF cost of 65535.

      A reference bandwidth of 1000 or 2000 would provide a much more reasonable cost for a 64 kbps interface, at 15625 or 31250, respectively.

    3. Set the interface to support on-demand OSPF routing:

       (interface)  ip ospf demand-circuit  

      This command allows the router to suppress the routing link-state advertisements over the configured interface. This is useful for an on-demand circuit such as ISDN or a switched virtual circuit (SVC).

    4. Configure OSPF network types:

       (interface)  ip ospf network  {  broadcast   non-broadcast  {  point-to-multipoint  [  non-broadcast  ]  point-to-point  }} 

      This command allows you to configure the OSPF network type regardless of the media type. By changing the network type, you alter the way the OSPF router forms adjacencies. This command is particularly useful for Frame Relay, ISDN on-demand, and X.25 networks.

    NOTE

    A loopback interface will automatically be flagged as OSPF network type "loopback" and will be advertised as a /32 route.

  11. (Required for nonbroadcast network types) Specify OSPF neighbors:

     (router)  neighbor   ip-address  [  priority   number  ] [  poll-interval   seconds  ]   [  cost   number  ] 

    This is used to form adjacencies for routers in nonbroadcast network environments. The priority option specifies the neighbor's priority for selection of the designated router for nonbroadcast or broadcast network types (the default is 0). poll-interval sets how often to poll the neighbor for nonbroadcast or broadcast network types (the default is 120 seconds). The cost option assigns a neighbor's cost. Without this command, the cost is based on the ip ospf cost command. On a point-to-multipoint interface, this is the only relevant option.

  12. (Optional) Use authentication for an OSPF area.

    1. Set up authentication:

       (router)  area   area-id   authentication  [  message-digest  ] 

      This sets up an area to require authentication. If authentication is enabled, it must be configured on all routers in the area. The message-digest option sets the authentication type for MD5 encryption.

    2. Set cleartext passwords (keys) on the interfaces:

       (interface)  ip ospf authentication-key   key  

      This sets the password on an interface in an area requiring plain-text authentication. The key argument represents the text string password.

      -OR-

    3. Set MD5 passwords (keys) on the interfaces:

       (interface)  ip ospf message-digest-key   keyid   md5   key  

      This sets the password (key) for an interface participating in an area configured for MD5 authentication. The key is entered as a text string of up to 16 alphanumeric characters . The keyid argument, ranging from 1 to 255, represents one possible authentication key that can be shared between neighboring routers. The same keyid on neighbors must have the same key string. To change an MD5 key to a new value, configure an additional keyid / key pair. The routers will roll over to the new key by continuing to advertise and accept the old key until all neighbors have been updated.

  13. (Optional) Set the administrative distance for OSPF routes:

     (router)  distance ospf  {[  intra-area   dist  ] [  inter-area   dist2  ] [  external   dist3  ]} 

    This command allows you to set the administrative distances for OSPF for each route type (each defaults to 110). Using this command, the router could distinguish between choosing an external route over an interarea route without comparing the metrics.

  14. (Optional) Change the route calculation timers:

     (router)  timers spf   spf-delay spf-holdtime  

    This sets the delay (the default is 5 seconds) and the holdtime (the default is 10 seconds) for the SPF calculation. The delay is how long in seconds after the topology change the router starts the SPF calculation. The holdtime is how long to wait between consecutive SPF updates. This command can help alleviate the overhead associated with the SPF calculation caused by multiple quick changes in the topology for OSPF routers that might not have much processing power.

  15. (Optional) Configure the OSPF process to resolve names using DNS:

     (global)  ip ospf name-lookup  

    This command configures the router to attempt to do a DNS lookup to resolve addresses to host names anytime a show OSPF command is executed.

    WARNING

    Because this command starts very much like an OSPF interface command, it is often enabled inadvertently during OSPF configuration. If this command is inadvertently turned on, OSPF displays might become very slow.

  16. (Optional) Enable OSPF redistribution to handle subnetted routes:

     (router)  redistribute   protocol  [  as-number   process-id  ]  subnets  

    One particular bit of information that is handy to remember when redistributing subnetted routes into an OSPF network is the redistribute subnets command. If this information isn't specified, OSPF picks out only classful routes for redistribution. Redistribution is discussed in greater detail in Section 8-4.

  17. (Optional) Summarize routes as they are redistributed into OSPF:

     (router)  summary-address   address mask  

    This command allows you to send a single advertisement for all routes redistributed into OSPF that fall within the address space defined by the address and mask options. Redistribution is discussed in greater detail in Section 8-3.

  18. (Optional) Force an Autonomous System Boundary Router (ASBR) to generate a default route into the OSPF domain:

     (router)  default-information originate  [  always  ] [  metric   value  ]   [  metric-type   1   2  ] [  route-map   map-name  ] 

    By enabling this command, you tell the ASBR to generate a default route into the OSPF domain. Basically, you tell all other participating OSPF routers that the ASBR is the router to send traffic to if no route exists in the routing table. The option always means that the ASBR should always send the route. The metric value specifies the metric for the default route (the default is 10). metric-type specifies the type of external link advertised into the OSPF domain. This field can be 1 (a type 1 external route) or 2 (a type 2 external route; this is the default). The route-map option specifies a route map that must permit default routes to be advertised.

  19. See the following sections for information on route-processing features:

    • 8-3: Redistributing Routing Information

    • 8-4: Filtering Routing Information

Example

Figure 7-4 shows a network diagram. In this example, the OSPF router ID has been set to 99.99.99.99 with the loopback interface IP address. OSPF has been enabled, and interface Ethernet 0 has been placed in Area 0. Interface Serial 0 has been placed in Area 1, and interface Serial 1 has been placed in Area 2. Area 1 has been configured as a totally stubby area. Area 0 has been configured for cleartext authentication. Area 2 is also a transit area for a discontiguous area, so a virtual link has been set up. Because a virtual link is connected to the backbone, the virtual link must also be set for authentication. Interface Ethernet 0 has been set up so that it cannot become a designated router. The hello and dead timers have been altered in Serial 1.

Figure 7-4. Network Diagram for the OSPF Example

graphics/07fig04.gif

  interface loopback 0   ip address 99.99.99.99 255.255.255.255   interface ethernet 0   ip address 1.2.2.1 255.255.255.0   ip ospf  priority 0   ip ospf authentication-key KaTiE   interface serial 0   ip address 1.5.5.1 255.255.255.0   encapsulation frame-relay   ip ospf network-type point-to-multipoint   frame-relay map ip 1.5.5.2 110 broadcast   frame-relay map ip 1.5.5.3 111 broadcast   interface serial 1   ip address 1.8.8.1 255.255.255.0   ip ospf hello-interval 20   ip ospf dead-interval 95   router ospf 101   network 1.2.2.1 0.0.0.0 area 0   network 1.5.5.1 0.0.0.0 area 1   network 1.8.8.1 0.0.0.0 area  2   area 1 stub no-summary   area 0 authentication   area 2 virtual-link 100.100.100.100 authentication-key KaTiE  


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