Configuring Additional Parameters
The commands presented in this section include both OSPF-specific commands and routing protocolindependent commands that are not limited to OSPF. You can use these commands to perform the tasks listed in Table 12.
Clear statistics for access lists, counters, redistributed routes, or processes.
access-list
- 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, Chapter 1, Configuring Routing Policy.
- Example
- 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.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 bostonhost1(config-route-map)#match ip address bostonhost1(config-route-map)#set metric-type type-1- Configure redistribution of the static routes into OSPF with route map boston.
host1(config)#router ospf 2host1(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 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.
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 1OSPFv2
host1(config-router)#ospf auto-cost reference-bandwidth 1000Example 2OSPFv3 host1((config-router)#)#auto-cost reference-bandwidth 1000When 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.
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, 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.
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.There is no no version. clear ipv6 ospf counters
host1#clear ipv6 ospf countersThere is no no version. clear ipv6 ospf process
host1#clear ipv6 ospf processThere is no no version. clear ip ospf database
host1#clear ip ospf databaseThere is no no version. clear ip ospf neighbor
- Use to clear an IP OSPF neighbor by specifying the IP address.
- Example
host1#clear ip ospf neighbor neighborAddressThere is no no version. 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 1
host1#clear ip ospf redistributionExample 2 host1#clear ipv6 ospf redistributionThere is no no version. 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.
- Example
host1(config)#router ospf 1host1(config-router)#default-information originate route-map 5Use the no version to disable this feature. 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.
- Example
host1(config-router)#disable-dynamic-redistributeUse the no version to reenable dynamic redistribution. distance
host1(config-router)#distance ospf external 60Default settings: ip ospf shutdown
host1(config-if)#ip ospf shutdownExample 2 host1(config-if)#ipv6 ospf shutdownUse the no version to enable OSPF on the interface. 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 1
host1(config-router)#log-adjacency-changes severity 3 verbosity lowExample 2 host1(config-router)#ospf log-adjacency-changes severity 3 verbosity lowUse the no version to halt logging of neighbor 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 116.
- 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.
- Example
host1(config-router)#maximum-paths 2Use the no version to restore the default value, 4. ospf shutdown
host1(config-router)#ospf shutdownUse the no version to reenable OSPF on the interface. 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.
- Example
host1(config-router)#passive-interface ethernet 1/0Use the no version to reenable the transmission of OSPF routing updates on the specified interface. redistribute
- Use to redistribute information from a routing domain other than OSPF into the OSPF domain.
- You can set the OSPF metric typetype 1 or type 2and 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 1
host1(config)#router ospf 5host1(config-router)#redistribute bgp route-map 4Example 2 host1(config)#router bgp 100host1(config-router)#redistribute ospf 5Use the no version to disable redistribution. 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.
- 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 *Use the no version to halt application of the route map. timers spf
- Use to configure the time between two consecutive SPF calculations.
- Set the time (in seconds) in the range 15; 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.
- Example
host1(config-router)#timers spf 2Use the no version to return to the default value, 3 seconds. 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 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 JUNOSe IP Services Configuration Guide, Chapter 1, Configuring Routing Policy, for information about configuring route maps.