[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 following tasks listed in Table 8-3:

Table 8-3 Additional configuration tasks
Filter and apply policy to routes.
Set the maximum paths.
Set a baseline for statistics.
Enable automatic cost calculation.
Set the redistribution routes.
Enable logs for OSPF neighbor changes.
Set the distance for OSPF routes.
Set SPF hold time.
Administratively disable OSPF.
Set a default metric.

    access-list
    route-map

1    Configure three static routes:

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

2    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.255

3    Configure a route map which matches the previous access list and applies a metric type 1 (OSPF):

host1(config)#route-map boston 
host1(config-route-map)#match ip address boston
host1(config-route-map)#set metric-type type-1

4    Configure redistribution of the static routes into OSPF with route map boston:

host1(config)#router ospf 2 
host1(config-router)#redistribute static route-map boston

5    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 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

host1#show ip ospf

Routing Process OSPF 1 with Router ID 5.106.7.1
 OSPF Statistics:
      Rcvd: 217935 total, 0 checksum errors
            8987 hello, 8367 database desc, 188 link state req
            159898 link state updates, 40484 link state acks
      Sent: 265026 total, 0 pkts dropped
            8927 hello, 8341 database desc, 53 link state req
            158571 link state updates, 89134 link state acks
 Supports only single TOS(TOS0) routes
 SPF schedule delay 0 secs, Hold time between two SPFs 3 secs
 Maximum path splits 1
 Area BACKBONE(0.0.0.0)
    Area is a transit area
    SPF algorithm executed 425 times
    ABR count 0
    ASBR count 1
    LSA Count 12
    Number of interfaces in this area is 24
    Area ranges are:
 Number of active areas in this router is 1
 1  normal, 0 stub, 0 NSSA.              

host1#baseline ip ospf
host1#show ip ospf delta

Routing Process OSPF 1 with Router ID 5.106.7.1
 OSPF Statistics:
      Rcvd: 0 total, 0 checksum errors
            0 hello, 0 database desc, 0 link state req
            0 link state updates, 0 link state acks
      Sent: 0 total, 0 pkts dropped
            0 hello, 0 database desc, 0 link state req
            0 link state updates, 0 link state acks
 Supports only single TOS(TOS0) routes
 SPF schedule delay 0 secs, Hold time between two SPFs 3 secs
 Maximum path splits 1
 Area BACKBONE(0.0.0.0)
    Area is a transit area
    SPF algorithm executed 425 times
    ABR count 0
    ASBR count 1
    LSA Count 12
    Number of interfaces in this area is 24
    Area ranges are:
 Number of active areas in this router is 1
 1  normal, 0 stub, 0 NSSA. 

    clear ip ospf redistribution

host1#clear ip ospf redistribution

    default-information originate

host1(config)#router ospf 1
host1(config-router)#default-information originate 

route-map 5

    disable-dynamic-redistribute

host1(config-router)#disable-dynamic-redistribute

    distance

host1(config-router)#distance ospf external 60

    ip ospf shutdown

host1(config-if)#ip ospf shutdown

    maximum-paths

host1(config-router)#maximum-paths 2

    ospf auto-cost reference-bandwidth

host1(config-router)#ospf auto-cost reference-bandwidth 1000

OSPF 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.

    ospf log-adjacency-changes

host1(config-router)#ospf log-adjacency-changes severity 3 
verbosity low

    ospf shutdown

host1(config-router)#ospf shutdown

    passive-interface

host1(config-router)#passive-interface ethernet 1/0

    redistribute

host1(config)#router ospf 5
host1(config-router)#redistribute bgp route-map 4
host1(config)#router bgp 100
host1(config-router)#redistribute ospf 5

    table-map

host1(config)#route-map dist1 permit 5
host1(config-route-map)#match community boston42
host1(config-route-map)#set distance 33
host1(config-route-map)#exit
host1(config)#router ospf 100
host1(config-router)#table-map dist1
host1(config-router)#exit
host1(config)#exit
host1#clear ip routes *

    timers spf

host1(config-router)#timers spf 2

Default 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 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 on configuring route maps.


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