[Contents] [Prev] [Next] [Index] [Report an Error]


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 tasks listed in Table 24.




Table 24: Additional Configuration Tasks

Filter and apply policy to routes.

Set the maximum paths.

Set a baseline for statistics.

Enable automatic cost calculation.

Clear statistics for access lists, counters, redistributed routes, or processes.

Enable logs for OSPF neighbor changes.

Set the redistribution routes.

Set SPF hold time.

Set the distance for OSPF routes.

Set a default metric.

Administratively disable OSPF.

access-list
    route-map

  1. Configure three static routes:
  2. host1(config)#ip route 20.20.20.0 255.255.255.0 192.168.1.0
    
    host1(config)#ip route 20.20.21.0 255.255.255.0 192.168.1.0
    
    host1(config)#ip route 20.21.0.0 255.255.255.0 192.168.1.0
    
    
    
  3. Configure an access list with filters on routes 20.20.20.0/24 and 20.20.21.0/24:
  4. host1(config)#access-list boston permit 20.20.0.0 0.0.255.255
    
    
    
  5. Configure a route map that matches the previous access list and applies a metric type 1 (OSPF):
  6. host1(config)#route-map boston 
    
    host1(config-route-map)#match ip address boston
    
    host1(config-route-map)#set metric-type type-1
    
    
    
  7. Configure redistribution of the static routes into OSPF with route map boston:
  8. host1(config)#router ospf 2 
    
    host1(config-router)#redistribute static route-map boston
    
    
    
  9. 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):
  10. host1#show ip ospf database
    
        OSPF Database
    
          Router Link States (Area 0.0.0.0)
    
    Link ID         ADV Router      Age         Seq#        Checksum
    
    192.168.1.250   192.168.1.250   3           0x80000006  0x39a1
    
    192.168.254.7   192.168.254.7   220         0x80000169  0xd2b5
    
          Network Link States (Area 0.0.0.0)
    
    Link ID         ADV Router      Age         Seq#        Checksum
    
    192.168.1.214   192.168.254.7   220         0x80000001  0xe0f2
    
          AS External Link States
    
    Link ID         ADV Router      Age         Seq#        Checksum
    
    20.20.20.0      192.168.1.250   3           0x80000001  0x6045
    
    20.20.21.0      192.168.1.250   3           0x80000001  0x554f
    
    
    

baseline ip ospf
    baseline ipv6 ospf

clear ipv6 ospf counters

clear ipv6 ospf process

clear ip ospf redistribution
    clear ipv6 ospf redistribution

default-information originate

disable-dynamic-redistribute

distance

ip ospf shutdown
    ipv6 ospf shutdown

maximum-paths

ospf auto-cost reference-bandwidth
    auto-cost reference-bandwidth

OSPF metric = bandwidth*1,000,000/link speed

For the previous example, a 64K link will get a metric of 15625, whereas a T1 link will have a metric of 647. The minimum value for the metric is 1.

ospf log-adjacency-changes
log-adjacency-changes

ospf shutdown

passive-interface

redistribute

table-map

timers spf

Default Metrics

Although the router 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 5
host1(config-router)#redistribute bgp metric 5

Alternatively, 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 any
host1(config)#route-map defmetric 
host1(config-route-map)#match ip address 1
host1(config-route-map)#set metric 10
host1(config-route-map)#exit
host1(config)#router ospf 5
host1(config-router)#redistribute bgp route-map defmetric
host1(config-router)#redistribute isis route-map defmetric

See Chapter 1, Configuring Routing Policy, for information about configuring route maps.


[Contents] [Prev] [Next] [Index] [Report an Error]