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 12.
Table 12: Additional Configuration Tasks
access-list
route-map
- 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
- host1(config)#access-list boston permit 20.20.0.0 0.0.255.255
- host1(config)#route-map boston
- host1(config-route-map)#match ip address boston
- host1(config-route-map)#set metric-type type-1
- host1(config)#router ospf 2
- host1(config-router)#redistribute static route-map
boston
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
auto-cost reference-bandwidth
ospf auto-cost reference-bandwidth
- host1(config-router)#ospf auto-cost reference-bandwidth
1000
- host1((config-router)#)#auto-cost reference-bandwidth
1000
OSPF metric = bandwidth*1,000,000/link speed
For the previous example, a 64K link yields a metric of 15625, whereas a T1 link yields a metric of 647. The minimum value for the metric is 1.
baseline ip ospf
baseline ipv6 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 ipv6 ospf counters
- host1#clear ipv6 ospf counters
clear ipv6 ospf process
- host1#clear ipv6 ospf process
clear ip ospf database
- host1#clear ip ospf database
clear ip ospf neighbor
![]() |
Note: When OSPF is configured and running over an NBMA network, do not issue the clear ip ospf neighbor command simultaneously on both ends of the OSPF link. Doing so brings the OSPF link down completely. In this event, you must do one of the following on both sides of the link to bring the link back up:
|
- host1#clear ip ospf neighbor neighborAddress
clear ip ospf redistribution
clear ipv6 ospf redistribution
![]() |
Caution: Using this command purges all external LSAs and reoriginates. |
- host1#clear ip ospf redistribution
- host1#clear ipv6 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
ipv6 ospf shutdown
- host1(config-if)#ip ospf shutdown
- host1(config-if)#ipv6 ospf shutdown
log-adjacency-changes
ospf log-adjacency-changes
- host1(config-router)#log-adjacency-changes
severity 3 verbosity low
- host1(config-router)#ospf log-adjacency-changes
severity 3 verbosity low
maximum-paths
- host1(config-router)#maximum-paths 2
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
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 Configuring Routing Policy in the JUNOSe IP Services Configuration Guide, for information about configuring route maps.