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 11.
Table 11: 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. | Enable use of the configured bandwidth for OSPF cost calculation. |
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 about configuring access lists and route maps, see JunosE IP Services Configuration Guide.
- Example
- 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
- 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
- Configure a route map that 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
- 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
- Use the show ip ospf database command to verify the effect of the redistribution (that 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
- Configure three static routes.
- 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.
- See access-list
- See route-map
auto-cost reference-bandwidth
ospf auto-cost reference-bandwidth
- Use to calculate the OSPFv2 or OSPFv3 interface cost according to bandwidth.
- Sets the OSPF metric for an interface according to the bandwidth specified.
- Affects OSPF metrics for existing OSPFv2 interfaces and OSPFv2 interfaces created after the execution of this command.
- Affects OSPF metrics for only OSPFv3 interfaces created after the execution of this command.
- 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 1—OSPFv2host1(config-router)#ospf auto-cost reference-bandwidth 1000
- Example 2—OSPFv3host1((config-router)#)#auto-cost reference-bandwidth 1000
- When you issue this command, the metric is calculated
as follows:
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.
- 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.
- See auto-cost reference-bandwidth
- See ospf auto-cost reference-bandwidth
baseline ip ospf
baseline ipv6 ospf
- Use to set a baseline for OSPF statistics and counters.
- The following example first displays the output of the show ip ospf command, which is shown before you run
the baseline ip ospf command; then it displays
the execution of the baseline ip ospf command;
and finally, it displays 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.
- Example
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. - There is no no version.
- See baseline ip ospf
- See baseline ipv6 ospf
clear ipv6 ospf counters
- Use to clear all OSPF IPv6 statistical counters for the virtual router.
- Example host1#clear ipv6 ospf counters
- There is no no version.
- See clear ipv6 ospf counters
clear ipv6 ospf process
- Use to clear the OSPF IPv6 process on the virtual router.
- Example host1#clear ipv6 ospf process
- There is no no version.
- See clear ipv6 ospf process
clear ip ospf database
- Use to delete all entries from the OSPF link-state database and to reset all adjacencies.
- Examplehost1#clear ip ospf database
- There is no no version.
clear ip ospf neighbor
- Use to clear an IP OSPF neighbor by specifying the IP address.
![]() | 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:
|
- Examplehost1#clear ip ospf neighbor neighborAddress
- There is no no version.
- See clear ip ospf neighbor
clear ip ospf redistribution
clear ipv6 ospf redistribution
- Use to clear and readvertise all of the routes that
have been previously redistributed into OSPF.

Caution: Using this command purges all external LSAs and reoriginates.
- Example 1host1#clear ip ospf redistribution
- Example 2host1#clear ipv6 ospf redistribution
- There is no no version.
- See clear ip ospf redistribution
- See clear ipv6 ospf redistribution
default-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 router automatically becomes an AS boundary router.
- An AS boundary router, 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.
- Examplehost1(config)#router ospf 1 host1(config-router)#default-information originate route-map 5
- Use the no version to disable this feature.
- See default-information originate
disable-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.
- Examplehost1(config-router)#disable-dynamic-redistribute
- Use the no version to reenable dynamic redistribution.
- See disable-dynamic-redistribute
distance
- Use to configure the administrative distance for OSPF routes.
- Examplehost1(config-router)#distance ospf external 60
- Default settings:
- Intra-area routes—110
- Interarea routes—112
- External routes—114
- Use the no version to restore the default values.
- See distance
ip ospf shutdown
ipv6 ospf shutdown
- Use to disable OSPF on the interface.
- Example 1host1(config-if)#ip ospf shutdown
- Example 2host1(config-if)#ipv6 ospf shutdown
- Use the no version to enable OSPF on the interface.
- See ip ospf shutdown
- See ipv6 ospf shutdown
log-adjacency-changes
ospf log-adjacency-changes
- Use to configure the router to send a log message when the state of an OSPF neighbor changes.
- Use the log-adjacency-changes command for OSPFv3 interfaces; use the ospf log-adjacency-changes command for OSPFv2 interfaces.
- Example 1host1(config-router)#log-adjacency-changes severity 3 verbosity low
- Example 2host1(config-router)#ospf log-adjacency-changes severity 3 verbosity low
- Use the no version to halt logging of neighbor changes.
- See log-adjacency-changes
- See ospf log-adjacency-changes
maximum-paths
- Use to control the maximum number of parallel routes that OSPF can support.
- The maximum number of routes can be in the range 1–16.
- The default for OSPF is 4 paths.
- To enable equal-cost multipath (ECMP) for OSPF, you need to specify a value for maximum paths greater than 1.
- Examplehost1(config-router)#maximum-paths 2
- Use the no version to restore the default value, 4.
- See maximum-paths
ospf bandwidth
- Use to direct the router to use the bandwidth configured on an OSPF interface as part of its calculation of the OSPF interface cost.
- The router uses various methods and precedence rules for the commands to calculate the OSPF interface cost. For information on the precedence based on the commands you use, see Methods for Calculating OSPF Interface Cost.
- Examplehost1(config-router)#ospf bandwidth
- Use the no version to disable the use of the configured bandwidth for OSPF interface cost calculation.
- See ospf bandwidth
ospf shutdown
- Use to administratively disable OSPF on the router.
- Examplehost1(config-router)#ospf shutdown
- Use the no version to reenable OSPF on the interface.
- See ospf shutdown
passive-interface
- Use to disable the transmission of routing updates on the interface, meaning that OSPFv2 or OSPFv3 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.
- Examplehost1(config-router)#passive-interface ethernet 1/0
- Use the no version to reenable the transmission of OSPF routing updates on the specified interface.
- See passive-interface
redistribute
- 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.
- If you do not specify route-map, all routes are redistributed. By default, all routes are imported as external type 2 routes.
- If you 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 1host1(config)#router ospf 5 host1(config-router)#redistribute bgp route-map 4
- Example 2host1(config)#router bgp 100 host1(config-router)#redistribute ospf 5
- Use the no version to disable redistribution.
- See redistribute.
table-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.
- Examplehost1(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 *
- Use the no version to halt application of the route map.
- See table-map
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 seconds.
- 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.
- Examplehost1(config-router)#timers spf 2
- Use the no version to return to the default value, 3 seconds.
- See timers spf
Methods for Calculating OSPF Interface Cost
The router uses the methods and precedence listed in Table 12 to calculate the OSPF interface cost.
Table 12: Methods and Precedence for Calculating OSPF Interface Cost
Cost Calculation Method | Precedence |
|---|---|
Issuing address cost command | Takes the highest precedence. The router uses the cost configured on the OSPF interface for cost calculation. |
Issuing ip ospf cost command | Takes precedence if you do not use the address cost command to configure the interface cost. The router uses the cost configured on the OSPF interface for cost calculation. |
Using actual bandwidth configured on OSPF interface | If you issue the ospf bandwidth command to enable use of the configured bandwidth for OSPF interface cost calculation, and do not use either the address cost command or the ip ospf cost command to configure the interface cost, the router uses the actual bandwidth configured on the OSPF interface for cost calculation. |
Issuing auto-cost reference-bandwidth command | Takes the lowest precedence. The router uses the reference bandwidth configured on the OSPF interface for cost calculation. |
![]() | Note: If you do not use any of the preceding methods to configure the OSPF interface cost, the router uses the interface speed to calculate the interface cost. |
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:
Alternatively, you can create one or more route maps that set the metric and apply them selectively to redistributed routes:
See JunosE IP Services Configuration Guide, for information about configuring route maps.
Hide Navigation Pane
Show Navigation Pane
SHA1
