Configuring Additional Parameters
The commands presented in this section include both OSPF-specific commands and routing protocol-independent commands that are not limited to OSPF. You can use these commands to perform the following tasks listed in Table 8-3:
Table 8-3 Additional configuration tasks
access-list
route-map
- Use the access-list command to create a standard or extended access list.
- Use the route-map command to create a route map.
- For detailed information on configuring access lists and route maps, see Chapter 1, Configuring Routing Policy.
- Example
1 Configure three static routes:
host1(config)#ip route 20.20.20.0 255.255.255.0 192.168.1.0host1(config)#ip route 20.20.21.0 255.255.255.0 192.168.1.0host1(config)#ip route 20.21.0.0 255.255.255.0 192.168.1.02 Configure an access list with filters on routes 20.20.20.0/24 and 20.20.21.0/24:
host1(config)#access-list boston permit 20.20.0.0 0.0.255.2553 Configure a route map which matches the previous access list and applies a metric type 1 (OSPF):
host1(config)#route-map bostonhost1(config-route-map)#match ip address bostonhost1(config-route-map)#set metric-type type-14 Configure redistribution of the static routes into OSPF with route map boston:
host1(config)#router ospf 2host1(config-router)#redistribute static route-map boston5 Use the show ip ospf database command to verify the effect of the redistribution (the two static routes matching the route map are redistributed as external type 1):
host1#show ip ospf databaseOSPF DatabaseRouter Link States (Area 0.0.0.0)Link ID ADV Router Age Seq# Checksum192.168.1.250 192.168.1.250 3 0x80000006 0x39a1192.168.254.7 192.168.254.7 220 0x80000169 0xd2b5Network Link States (Area 0.0.0.0)Link ID ADV Router Age Seq# Checksum192.168.1.214 192.168.254.7 220 0x80000001 0xe0f2AS External Link StatesLink ID ADV Router Age Seq# Checksum20.20.20.0 192.168.1.250 3 0x80000001 0x604520.20.21.0 192.168.1.250 3 0x80000001 0x554f
- Use the no version of the access-list command to remove the access list or the specified entry in the access list.
- Use the no version of the route-map command to remove an entry.
baseline ip ospf
- Use to set a baseline for OSPF statistics and counters.
- The following example first displays the output of the show ip ospf command shown before you run the baseline ip ospf command; then, the execution of the baseline ip ospf command; and finally, the display of the show ip ospf command run after you execute the baseline ip ospf command.
- The output of the show ip ospf command run before the baseline ip ospf command reflects the up-to-date packet counters.
- The output of the show ip ospf delta command run after you run the baseline ip ospf command reflects the baseline set for OSPF statistics and counters.
host1#show ip ospfRouting Process OSPF 1 with Router ID 5.106.7.1OSPF Statistics:Rcvd: 217935 total, 0 checksum errors8987 hello, 8367 database desc, 188 link state req159898 link state updates, 40484 link state acksSent: 265026 total, 0 pkts dropped8927 hello, 8341 database desc, 53 link state req158571 link state updates, 89134 link state acksSupports only single TOS(TOS0) routesSPF schedule delay 0 secs, Hold time between two SPFs 3 secsMaximum path splits 1Area BACKBONE(0.0.0.0)Area is a transit areaSPF algorithm executed 425 timesABR count 0ASBR count 1LSA Count 12Number of interfaces in this area is 24Area ranges are:Number of active areas in this router is 11 normal, 0 stub, 0 NSSA.host1#baseline ip ospfhost1#show ip ospf deltaRouting Process OSPF 1 with Router ID 5.106.7.1OSPF Statistics:Rcvd: 0 total, 0 checksum errors0 hello, 0 database desc, 0 link state req0 link state updates, 0 link state acksSent: 0 total, 0 pkts dropped0 hello, 0 database desc, 0 link state req0 link state updates, 0 link state acksSupports only single TOS(TOS0) routesSPF schedule delay 0 secs, Hold time between two SPFs 3 secsMaximum path splits 1Area BACKBONE(0.0.0.0)Area is a transit areaSPF algorithm executed 425 timesABR count 0ASBR count 1LSA Count 12Number of interfaces in this area is 24Area ranges are:Number of active areas in this router is 11 normal, 0 stub, 0 NSSA.clear ip ospf redistribution
host1#clear ip ospf redistributiondefault-information originate
- Use to generate a default route into an OSPF routing domain.
- When you use this command to redistribute routes into an OSPF routing domain, the system automatically becomes an ASBR.
- An ASBR, however, does not, by default, generate a default route into the OSPF routing domain. The software must have a default route before it generates one, except when you have specified the always keyword.
- You can specify a metric for the route or specify that the route be OSPF external type 1 or 2.
- Example
host1(config)#router ospf 1host1(config-router)#default-information originate route-map 5disable-dynamic-redistribute
- Use to halt the dynamic redistribution of routes that are initiated by changes to a route map.
- Dynamic redistribution is enabled by default.
- Example
host1(config-router)#disable-dynamic-redistributedistance
host1(config-router)#distance ospf external 60ip ospf shutdown
host1(config-if)#ip ospf shutdownmaximum-paths
- Use to control the maximum number of parallel routes that OSPF can support.
- The maximum number of routes can range from 1-16.
- The default for OSPF is 4 paths.
- To enable equal-cost multipath (ECMP) for OSPF, you need to specify a value for maxPaths greater than 1.
- Example
host1(config-router)#maximum-paths 2ospf auto-cost reference-bandwidth
- Use to calculate OSPF interface cost according to bandwidth.
- Sets the OSPF metric for an interface according to the bandwidth specified.
- Affects OSPF metrics only for OSPF interfaces created after its execution.
- This command's value overrides the cost resulting from the command.
- If you want this command to apply to OSPF interfaces already configured, you need to bounce the existing interfaces: Use the no network and then the network command for the selected OSPF interfaces.
- Example
host1(config-router)#ospf auto-cost reference-bandwidth 1000OSPF metric = bandwidth*1,000,000/link speed
For the previous example, a 64K link will get a metric of 15625, while a T1 link will have a metric of 647. The minimum value for the metric is 1.
- If you never issue the ospf auto-cost reference-bandwidth command, OSPF calculates the cost as 108/link speed.
- Use the no version to assign cost based only on the interface type.
ospf log-adjacency-changes
- Use to configure the router to send a log message when the state of an OSPF neighbor changes.
- Example
host1(config-router)#ospf log-adjacency-changes severity 3 verbosity lowospf shutdown
host1(config-router)#ospf shutdownpassive-interface
- Use to disable the transmission of routing updates on the interface, meaning that OSPF routing information is neither sent by nor received through the interface.
- The specified interface appears as a stub network in the OSPF domain.
- By default, OSPF is enabled on a configured OSPF interface.
- Example
host1(config-router)#passive-interface ethernet 1/0redistribute
- Use to redistribute information from a routing domain other than OSPF into the OSPF domain.
- You can set the OSPF metric type—type 1 or type 2—and set a metric for all redistributed routes.
- Example 1
host1(config)#router ospf 5host1(config-router)#redistribute bgp route-map 4
- If you do not specify route-map, all routes are redistributed. By default, all routes are imported as external type 2 routes.
- If you do specify route-map, but do not list any route map tags, no routes are imported.
- Use to redistribute routes from OSPF into other non-OSPF routing domains.
- Example 2
host1(config)#router bgp 100host1(config-router)#redistribute ospf 5table-map
- Use to apply a policy to modify distance, metric, metric type, route type, or tag values of OSPF routes about to be added to the IP routing table.
- The new route map is applied to all routes currently in and those subsequently placed in the forwarding table. Previously redistributed routes are redistributed with the changes caused by the route map.
- To remove from the forwarding table any old routes that are now disallowed by the specified route map, you must refresh the IP routing table with the clear ip routes * command.
- Example
host1(config)#route-map dist1 permit 5host1(config-route-map)#match community boston42host1(config-route-map)#set distance 33host1(config-route-map)#exithost1(config)#router ospf 100host1(config-router)#table-map dist1host1(config-router)#exithost1(config)#exithost1#clear ip routes *timers spf
- Use to configure the time between two consecutive SPF calculations.
- Set the time (in seconds) in the range 1-5; the default value is 3.
- If you set the hold time to 0, there is no delay between two consecutive SPF calculations. They can be done one immediately after the other.
- Example
host1(config-router)#timers spf 2Default Metrics
Although the system does not support a default-metric command, the redistribute command provides two ways to set a default metric for redistributed routes.
You can simply configure a metric with the redistribute command to apply to all routes redistributed from the specified source protocol:
host1(config)#router ospf 5host1(config-router)#redistribute bgp metric 5Alternatively, you can create one or more route maps that set the metric and apply them selectively to redistributed routes:
host1(config)#access-list 1 permit any anyhost1(config)#route-map defmetrichost1(config-route-map)#match ip address 1host1(config-route-map)#set metric 10host1(config-route-map)#exithost1(config)#router ospf 5host1(config-router)#redistribute bgp route-map defmetrichost1(config-router)#redistribute isis route-map defmetricSee Chapter 1, Configuring Routing Policy, for information on configuring route maps.