Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols, Release 12.2
OSPF commands

Table Of Contents

OSPF Commands

area authentication

area default-cost

area filter-list

area nssa

area range

area stub

area virtual-link

auto-cost

clear ip ospf

compatible rfc1583

default-information originate (OSPF)

default-metric (OSPF)

discard-route

distance ospf

domain-tag

ignore lsa mospf

ip ospf authentication

ip ospf authentication-key

ip ospf cost

ip ospf database-filter all out

ip ospf dead-interval

ip ospf demand-circuit

ip ospf flood-reduction

ip ospf hello-interval

ip ospf message-digest-key

ip ospf mtu-ignore

ip ospf name-lookup

ip ospf network

ip ospf priority

ip ospf retransmit-interval

ip ospf transmit-delay

log-adjacency-changes

neighbor (OSPF)

neighbor database-filter

network area

router-id

router ospf

show ip ospf

show ip ospf border-routers

show ip ospf database

show ip ospf flood-list

show ip ospf interface

show ip ospf neighbor

show ip ospf request-list

show ip ospf retransmission-list

show ip ospf summary-address

show ip ospf virtual-links

summary-address (OSPF)

timers lsa-group-pacing

timers spf


OSPF Commands


Use the commands in this chapter to configure and monitor the Open Shortest Path First (OSPF) routing protocol. For OSPF configuration information and examples, refer to the "Configuring OSPF" chapter of the Cisco IOS IP Configuration Guide.

area authentication

To enable authentication for an OSPF area, use the area authentication command in router configuration mode. To remove an authentication specification of an area or a specified area from the configuration, use the no form of this command.

area area-id authentication [message-digest]

no area area-id authentication [message-digest]

Syntax Description

area-id

Identifier of the area for which authentication is to be enabled. The identifier can be specified as either a decimal value or an IP address.

message-digest

(Optional) Enables Message Digest 5 (MD5) authentication on the area specified by the area-id argument.


Defaults

Type 0 authentication (no authentication)

Command Modes

Router configuration

Command History

Release
Modification

10.0

This command was introduced.

11.0

The message-digest keyword was added.


Usage Guidelines

Specifying authentication for an area sets the authentication to Type 1 (simple password) as specified in RFC 1247. If this command is not included in the configuration file, authentication of Type 0 (no authentication) is assumed.

The authentication type must be the same for all routers and access servers in an area. The authentication password for all OSPF routers on a network must be the same if they are to communicate with each other via OSPF. Use the ip ospf authentication-key interface command to specify this password.

If you enable MD5 authentication with the message-digest keyword, you must configure a password with the ip ospf message-digest-key interface command.

To remove the authentication specification for an area, use the no form of this command with the authentication keyword.


Note To remove the specified area from the software configuration, use the no area area-id command (with no other keywords). That is, the no area area-id command removes all area options, such as area authentication, area default-cost, area nssa, area range, area stub, and area virtual-link.


Examples

The following example mandates authentication for areas 0 and 10.0.0.0 of OSPF routing process 201. Authentication keys are also provided.

interface ethernet 0
 ip address 192.168.251.201 255.255.255.0
 ip ospf authentication-key adcdefgh
!
interface ethernet 1
 ip address 10.56.0.201 255.255.0.0
 ip ospf authentication-key ijklmnop
!
router ospf 201
 network 10.0.0.0 0.255.255.255 area 10.0.0.0
 network 192.168.0.0 0.0.255.255 area 0
 area 10.0.0.0 authentication
 area 0 authentication

Related Commands

Command
Description

area default-cost

Specifies a cost for the default summary route sent into a stub area.

area stub

Defines an area as a stub area.

ip ospf authentication-key

Assigns a password to be used by neighboring routers that are using the simple password authentication of OSPF.

ip ospf message-digest-key

Enables OSPF MD5 authentication.


area default-cost

To specify a cost for the default summary route sent into a stub or not so stubby area (NSSA), use the area default-cost command in router configuration mode. To remove the assigned default route cost, use the no form of this command.

area area-id default-cost cost

no area area-id default-cost cost

Syntax Description

area-id

Identifier for the stub or NSSA. The identifier can be specified as either a decimal value or as an IP address.

cost

Cost for the default summary route used for a stub or NSSA. The acceptable value is a 24-bit number.


Defaults

cost: 1

Command Modes

Router configuration

Command History

Release
Modification

10.0

This command was introduced.


Usage Guidelines

The command is used only on an Area Border Router (ABR) attached to a stub or NSSA.

There are two stub area router configuration commands: the stub and default-cost options of the area command. In all routers and access servers attached to the stub area, the area should be configured as a stub area using the stub option of the area command. Use the default-cost option only on an ABR attached to the stub area. The default-cost option provides the metric for the summary default route generated by the ABR into the stub area.


Note To remove the specified area from the software configuration, use the no area area-id command (with no other keywords). That is, the no area area-id command removes all area options, such as area authentication, area default-cost, area nssa, area range, area stub, and area virtual-link.


Examples

The following example assigns a default cost of 20 to stub network 10.0.0.0:

interface ethernet 0
 ip address 10.56.0.201 255.255.0.0
!
router ospf 201
 network 10.0.0.0 0.255.255.255 area 10.0.0.0
 area 10.0.0.0 stub
 area 10.0.0.0 default-cost 20

Related Commands

Command
Description

area authentication

Enables authentication for an OSPF area.

area stub

Defines an area as a stub area.


area filter-list

To filter prefixes advertised in type 3 link-state advertisements (LSAs) between Open Shortest Path First (OSPF) areas of an area border router (ABR), use the area filter-list command. To change or cancel the filter, use the no form of this command.

area {area-id} filter-list prefix {prefix-list-name in | out}

no area {area-id} filter-list prefix {prefix-list-name in | out}

Syntax Description

area-id

Identifier of the area for which filtering is configured. The identifier can be specified as either a decimal value or an IP address.

prefix

Indicates that a prefix list is used.

prefix-list-name

Name of a prefix list.

in

Prefix-list applied to prefixes advertised to the specified area from other areas.

out

Prefix-list applied to prefixes advertised out of the specified area to other areas.


Defaults

This command has no default behavior.

Command Modes

Router configuration

Command History

Release
Modification

12.0(15)S

This command was introduced.


Usage Guidelines

With this feature enabled in the "in" direction, all type 3 LSAs originated by the ABR to this area, based on information from all other areas, are filtered by the prefix list. Type 3 LSAs that were originated as a result of the area-range command in another area are treated like any other type 3 LSA that was originated individually. Any prefix that does not match an entry in the prefix list is implicitly denied.

With this feature enabled in the "out" direction, all type 3 LSAs advertised by the ABR, based on information from this area to all other areas, are filtered by the prefix list. If the area-range command has been configured for this area, type 3 LSAs that correspond to the area range are sent to all other areas, only if there is at least one prefix in the area range that matches an entry in the prefix list.

If all specific prefixes are denied by the prefix list, type 3 LSAs that correspond to the area-range command will not be sent to any other area. Prefixes that are not permitted by the prefix list are implicitly denied.

Examples

The following example filters prefixes that are sent from all other areas to area 1:

area 1 filter-list prefix-list AREA_1 in

area nssa

To configure an area as a not-so-stubby area (NSSA), use the area nssa command in router configuration mode. To remove the NSSA distinction from the area, use the no form of this command.

area area-id nssa [no-redistribution] [default-information-originate [metric] [metric-type]] [no-summary]

no area area-id nssa [no-redistribution] [default-information-originate [metric] [metric-type]] [no-summary]

Syntax Description

area-id

Identifier of the area for which authentication is to be enabled. The identifier can be specified as either a decimal value or an IP address.

no-redistribution

(Optional) Used when the router is an NSSA Area Border Router (ABR) and you want the redistribute command to import routes only into the normal areas, but not into the NSSA area.

default-information-
originate

(Optional) Used to generate a Type 7 default into the NSSA area. This keyword takes effect only on NSSA ABR or NSSA Autonomous System Boundary Router (ASBR).

metric

OSPF default metric.

metric-type

OSPF metric type for default routes.

no-summary

(Optional) Allows an area to be a not-so-stubby area but not have summary routes injected into it.


Defaults

No NSSA area is defined.

Command Modes

Router configuration

Command History

Release
Modification

10.0

This command was introduced.


Usage Guidelines

To remove the specified area from the software configuration, use the no area area-id command (with no other keywords). That is, the no area area-id command removes all area options, such as area authentication, area default-cost, area nssa, area range, area stub, and area virtual-link.

Examples

The following example makes area 1 an NSSA area:

router ospf 1
 redistribute rip subnets
 network 172.19.92.0 0.0.0.255 area 1
 area 1 nssa

area range

To consolidate and summarize routes at an area boundary, use the area range command in router configuration mode. To disable this function, use the no form of this command.

area area-id range ip-address mask [advertise | not-advertise] [cost cost]

no area area-id range ip-address mask [advertise | not-advertise] [cost cost]

Syntax Description

area-id

Identifier of the area about which routes are to be summarized. It can be specified as either a decimal value or as an IP address.

ip-address

IP address.

mask

IP address mask.

advertise

(Optional) Sets the address range status to advertise and generates a Type 3 summary link-state advertisement (LSA).

not-advertise

(Optional) Sets the address range status to DoNotAdvertise. The Type 3 summary LSA is suppressed, and the component networks remain hidden from other networks.

cost cost

(Optional) Metric or cost for this summary route, which is used during OSPF SPF calculation to determine the shortest paths to the destination. The value can be 0 to 16777215.


Defaults

This command is disabled by default.

Command Modes

Router configuration

Command History

Release
Modification

10.0

This command was introduced.

12.2

The cost cost keyword and argument were added.


Usage Guidelines

The area range command is used only with Area Border Routers (ABRs). It is used to consolidate or summarize routes for an area. The result is that a single summary route is advertised to other areas by the ABR. Routing information is condensed at area boundaries. External to the area, a single route is advertised for each address range. This behavior is called route summarization.

Multiple area router configuration commands specifying the range option can be configured. Thus, OSPF can summarize addresses for many different sets of address ranges.


Note To remove the specified area from the software configuration, use the no area area-id command (with no other keywords). That is, the no area area-id command removes all area options, such as area authentication, area default-cost, area nssa, area range, area stub, and area virtual-link.


Examples

The following example specifies one summary route to be advertised by the ABR to other areas for all subnets on network 10.0.0.0 and for all hosts on network 192.168.110.0:

interface ethernet 0
 ip address 192.168.110.201 255.255.255.0
!
interface ethernet 1
 ip address 192.168.120.201 255.255.255.0
!
router ospf 201
 network 192.168.110.0 0.0.0.255 area 0
 area 10.0.0.0 range 10.0.0.0 255.0.0.0
 area 0 range 192.168.110.0 255.255.0.0 cost 60

Related Commands

Command
Description

area authentication

Enables authentication for an OSPF area.

area default-cost

Specifies a cost for the default summary route sent into a stub area.

area nssa

Configures an area as an NSSA.

area stub

Defines an area as a stub area.

area virtual-link

Defines an OSPF virtual link.


area stub

To define an area as a stub area, use the area stub command in router configuration mode. To disable this function, use the no form of this command.

area area-id stub [no-summary]

no area area-id stub [no-summary]

Syntax Description

area-id

Identifier for the stub area; either a decimal value or an IP address.

no-summary

(Optional) Prevents an Area Border Router (ABR) from sending summary link advertisements into the stub area.


Defaults

No stub area is defined.

Command Modes

Router configuration

Command History

Release
Modification

10.0

This command was introduced.


Usage Guidelines

You must configure the area stub command on all routers and access servers in the stub area. Use the area router configuration command with the default-cost option to specify the cost of a default internal router sent into a stub area by an ABR.

There are two stub area router configuration commands: the stub and default-cost options of the area router configuration command. In all routers attached to the stub area, the area should be configured as a stub area using the stub option of the area command. Use the default-cost option only on an ABR attached to the stub area. The default-cost option provides the metric for the summary default route generated by the ABR into the stub area.

To further reduce the number of link-state advertisements (LSAs) sent into a stub area, you can configure the no-summary keyword on the ABR to prevent it from sending summary LSAs (LSA type 3) into the stub area.


Note To remove the specified area from the software configuration, use the no area area-id command (with no other keywords). That is, the no area area-id command removes all area options, such as area authentication, area default-cost, area nssa, area range, area stub, and area virtual-link.


Examples

The following example assigns a default cost of 20 to stub network 10.0.0.0:

interface ethernet 0
 ip address 10.56.0.201 255.255.0.0
!
router ospf 201
 network 10.0.0.0 0.255.255.255 area 10.0.0.0
 area 10.0.0.0 stub
 area 10.0.0.0 default-cost 20

Related Commands

Command
Description

area authentication

Enables authentication for an OSPF area.

area default-cost

Specifies a cost for the default summary route sent into a stub area.


area virtual-link

To define an OSPF virtual link, use the area virtual-link command in router configuration mode with the optional parameters. To remove a virtual link, use the no form of this command.

area area-id virtual-link router-id [authentication [message-digest | null]] [hello-interval seconds] [retransmit-interval seconds] [transmit-delay seconds] [dead-interval seconds] [[authentication-key key] | [message-digest-key key-id md5 key]]

no area area-id virtual-link router-id [authentication [message-digest | null]] [hello-interval seconds] [retransmit-interval seconds] [transmit-delay seconds] [dead-interval seconds] [[authentication-key key] | [message-digest-key key-id md5 key]]

no area area-id

Syntax Description

area-id

Area ID assigned to the transit area for the virtual link. This can be either a decimal value or a valid IP address. There is no default.

router-id

Router ID associated with the virtual link neighbor. The router ID appears in the show ip ospf display. The router ID is internally derived by each router from the interface IP addresses. This value must be entered in the format of an IP address. There is no default.

authentication

(Optional) Specifies authentication type.

message-digest

(Optional) Specifies that message-digest authentication is used.

null

(Optional) No authentication is used. Overrides password or message-digest authentication if configured for the area.

hello-interval seconds

(Optional) Time (in seconds) between the hello packets that the Cisco  IOS software sends on an interface. Unsigned integer value to be advertised in the hello packets. The value must be the same for all routers and access servers attached to a common network. The default is 10 seconds.

retransmit-interval seconds

(Optional) Time (in seconds) between link-state advertisement (LSA) retransmissions for adjacencies belonging to the interface. Expected round-trip delay between any two routers on the attached network. The value must be greater than the expected round-trip delay. The default is 5 seconds.

transmit-delay seconds

(Optional) Estimated time (in seconds) required to send a link-state update packet on the interface. Integer value that must be greater than zero. LSAs in the update packet have their age incremented by this amount before transmission. The default value is 1 second.

dead-interval seconds

(Optional) Time (in seconds) that hello packets are not seen before a neighbor declares the router down. Unsigned integer value. The default is four times the hello interval, or 40 seconds. As with the hello interval, this value must be the same for all routers and access servers attached to a common network.

authentication-key key

(Optional) Password to be used by neighboring routers. It is any continuous string of characters that you can enter from the keyboard up to 8 bytes long. This string acts as a key that will allow the authentication procedure to generate or verify the authentication field in the OSPF header. This key is inserted directly into the OSPF header when originating routing protocol packets. A separate password can be assigned to each network on a per-interface basis. All neighboring routers on the same network must have the same password to be able to route OSPF traffic. The password is encrypted in the configuration file if the service password-encryption command is enabled. There is no default value.

message-digest-key key-id md5 key

(Optional) Key identifier and password to be used by neighboring routers and this router for Message Digest 5 (MD5) authentication. The key-id argument is a number in the range from 1 to 255. The key is an alphanumeric string of up to 16 characters. All neighboring routers on the same network must have the same key identifier and key to be able to route OSPF traffic. There is no default value.


Defaults

area-id: No area ID is predefined.
router-id: No router ID is predefined.
hello-interval seconds: 10 seconds
retransmit-interval seconds: 5 seconds
transmit-delay seconds: 1 second
dead-interval seconds: 40 seconds
authentication-key key: No key is predefined.
message-digest-key key-id md5 key: No key is predefined.

Command Modes

Router configuration

Command History

Release
Modification

10.0

This command was introduced.

11.0

The message-digest-key key-id md5 key keywords and arguments were added.

12.0

The authentication, message-digest, and null keywords were added.


Usage Guidelines

In OSPF, all areas must be connected to a backbone area. If the connection to the backbone is lost, it can be repaired by establishing a virtual link.

The smaller the hello interval, the faster topological changes will be detected, but more routing traffic will ensue.

The setting of the retransmit interval should be conservative, or needless retransmissions will result. The value should be larger for serial lines and virtual links.

The transmit delay value should take into account the transmission and propagation delays for the interface.

The Cisco IOS software will use the specified authentication key only when authentication is enabled for the backbone with the area area-id authentication router configuration command.

The two authentication schemes, simple text and MD5 authentication, are mutually exclusive. You can specify one or the other or neither. Any keywords and arguments you specify after authentication-key key or message-digest-key key-id md5 key are ignored. Therefore, specify any optional arguments before such a keyword-argument combination.

For Cisco IOS Release 12.2 and later releases, authentication type now is specified on a per-interface basis, rather than on a per-area basis, per RFC 2178. For backward compatability, authentication type for an area is still supported. If the authentication type is not specified for an interface, the interface will use the authentication type that was specified for the area. If no authentication type has been specified for the area, the area default is null authentication.


Note Each virtual link neighbor must include the transit area ID and the corresponding virtual link neighbor router ID in order for a virtual link to be properly configured. Use the show ip ospf EXEC command to see the router ID.



Note To remove the specified area from the software configuration, use the no area area-id command (with no other keywords). That is, the no area area-id command removes all area options, such as area authentication, area default-cost, area nssa, area range, area stub, and area virtual-link.


Examples

The following example establishes a virtual link with default values for all optional parameters:

router ospf 201
 network 10.0.0.0 0.255.255.255 area 10.0.0.0
 area 10.0.0.0 virtual-link 10.3.4.5

The following example establishes a virtual link with MD5 authentication:

router ospf 201
 network 10.0.0.0 0.255.255.255 area 10.0.0.0
 area 10.0.0.0 virtual-link 10.3.4.5 message-digest-key 3 md5 sa5721bk47

Related Commands

Command
Description

area authentication

Enables authentication for an OSPF area.

service password-encryption

Encrypts passwords.

show ip ospf

Displays general information about OSPF routing processes.


auto-cost

To control how OSPF calculates default metrics for the interface, use the auto-cost command in router configuration mode. To assign cost based only on the interface type, use the no form of this command.

auto-cost reference-bandwidth ref-bw

no auto-cost reference-bandwidth

Syntax Description

reference-bandwidth ref-bw

Rate in Mbps (bandwidth). The range is from 1 to 4294967; the default is 100.


Defaults

100 Mbps

Command Modes

Router configuration

Command History

Release
Modification

11.2

This command was introduced.


Usage Guidelines

In Cisco IOS Release 10.3 and later releases, by default OSPF will calculate the OSPF metric for an interface according to the bandwidth of the interface. For example, a 64K link will get a metric of 1562, and a T1 link will have a metric of 64.

The OSPF metric is calculated as the ref-bw value divided by the bandwidth, with ref-bw equal to 108 by default, and bandwidth determined by the bandwidth command. The calculation gives FDDI a metric of 1.

If you have multiple links with high bandwidth (such as FDDI or ATM), you might want to use a larger number to differentiate the cost on those links.

The value set by the ip ospf cost command overrides the cost resulting from the auto-cost command.

Examples

The following example changes the cost of the FDDI link to 10, while the gigabit Ethernet link remains at a cost of 1. Thus, the link costs are differentiated.

router ospf 1
 auto-cost reference-bandwidth 1000

Related Commands

Command
Description

ip ospf cost

Explicitly specifies the cost of sending a packet on an interface.


clear ip ospf

To clear redistribution based on the OSPF routing process ID, use the clear ip ospf command in privileged EXEC mode.

clear ip ospf [pid] {process | redistribution | counters [neighbor [neighbor-interface] [neighbor-id]]}

Syntax Description

pid

(Optional) Process ID.

process

Reset OSPF process.

redistribution

Clear OSPF route redistribution.

counters

OSPF counters.

neighbor

(Optional) Neighbor statistics per interface.

neighbor-interface

(Optional) Neighbor interface.

neighbor-id

(Optional) Neighbor ID.


Command Modes

Privileged EXEC

Command History

Release
Modification

11.1

This command was introduced.


Usage Guidelines

Use the pid option to clear only one OSPF process. If the pid option is not specified, all OSPF processes are cleared.

Examples

The following example clears all OSPF processes:

clear ip ospf process

compatible rfc1583

To restore the method used to calculate summary route costs per RFC 1583, use the compatible rfc1583 command in router configuration mode. To disable RFC 1583 compatibility, use the no form of this command.

compatible rfc1583

no compatible rfc1583

Syntax Description

This command has no arguments or keywords.

Defaults

Compatible with RFC 1583.

Command Modes

Router configuration

Command History

Release
Modification

12.1(2)T

This command was introduced.


Usage Guidelines

This command is backward compatible with Cisco IOS Release 12.0.

To minimize the chance of routing loops, all OSPF routers in an OSPF routing domain should have RFC compatibility set identically.

Because of the introduction of RFC 2328, OSPF Version 2, the method used to calculate summary route costs has changed. Use the no compatible rfc1583 command to enable the calculation method used per RFC 2328.

Examples

The following example specifies that the router process is compatible with RFC 1583:

router ospf 1  
  compatible rfc1583
 !

default-information originate (OSPF)

To generate a default external route into an OSPF routing domain, use the default-information originate command in router configuration mode. To disable this feature, use the no form of this command.

default-information originate [always] [metric metric-value] [metric-type type-value] [route-map map-name]

no default-information originate [always] [metric metric-value] [metric-type type-value] [route-map map-name]

Syntax Description

always

(Optional) Always advertises the default route regardless of whether the software has a default route.

metric metric-value

(Optional) Metric used for generating the default route. If you omit a value and do not specify a value using the default-metric router configuration command, the default metric value is 1. The value used is specific to the protocol.

metric-type type-value

(Optional) External link type associated with the default route advertised into the OSPF routing domain. It can be one of the following values:

1—Type 1 external route

2—Type 2 external route

The default is type 2 external route.

route-map map-name

(Optional) Routing process will generate the default route if the route map is satisfied.


Defaults

This command is disabled by default.

Command Modes

Router configuration

Command History

Release
Modification

10.0

This command was introduced.


Usage Guidelines

Whenever you use the redistribute or the default-information router configuration command to redistribute routes into an OSPF routing domain, the Cisco IOS software automatically becomes an Autonomous System Boundary Router (ASBR). However, an ASBR does not, by default, generate a default route into the OSPF routing domain. The software still must have a default route for itself before it generates one, except when you have specified the always keyword.

When you use this command for the OSPF process, the default network must reside in the routing table, and you must satisfy the route-map map-name keyword and argument. Use the default-information originate always route-map map-name form of the command when you do not want the dependency on the default network in the routing table.

Notes:

If you use the ip prefix-list command with the default-information originate command to generate default routes, specify only IP adress matching. Avoid using the ge and le keywords.

For example, the following command works:

ip prefix-list anyrtcondition seq 5 permit 0.0.0.0/0

However, the following command is not supported:

ip prefix-list anyrtcondition seq 5 permit 0.0.0.0/0 le 32

Using the ip prefix-list command with the route-map and match ip next-hop commands is not supported. Only IP address match clauses are supported.

Examples

The following example specifies a metric of 100 for the default route redistributed into the OSPF routing domain and an external metric type of Type 1:

router ospf 109
 redistribute igrp 108 metric 100 subnets
 default-information originate metric 100 metric-type 1

Related Commands

Command
Description

redistribute (IP)

Redistributes routes from one routing domain into another routing domain.


default-metric (OSPF)

To set default metric values for the OSPF routing protocol, use the default-metric command in router configuration mode. To return to the default state, use the no form of this command.

default-metric metric-value

no default-metric metric-value

Syntax Description

metric-value

Default metric value appropriate for the specified routing protocol.


Defaults

Built-in, automatic metric translations, as appropriate for each routing protocol. The metric of redistributed connected and static routes is set to 0.

Command Modes

Router configuration

Command History

Release
Modification

10.0

This command was introduced.


Usage Guidelines

The default-metric command is used in conjunction with the redistribute router configuration command to cause the current routing protocol to use the same metric value for all redistributed routes. A default metric helps solve the problem of redistributing routes with incompatible metrics. Whenever metrics do not convert, using a default metric provides a reasonable substitute and enables the redistribution to proceed.


Note When enabled, the default-metric command applies a metric value of 0 to redistributed connected routes. The default-metric command does not override metric values that are applied with the redistribute command.


Examples

The following example shows a router in autonomous system 109 using both the Routing Information Protocol (RIP) and the OSPF routing protocols. The example advertises OSPF-derived routes using RIP and assigns the Internal Gateway Routing Protocol (IGRP)-derived routes a RIP metric of 10.

router rip
 default-metric 10
 redistribute ospf 109

Related Commands

Command
Description

redistribute (IP)

Redistributes routes from one routing domain into another routing domain.


discard-route

To reinstall either an external or internal discard route that was previously removed, use the discard-route command in router configuration mode. To remove either an external or internal discard route, use the no form of this command.

discard-route [external | internal]

no discard-route [external | internal]

Syntax Description

external

(Optional) Reinstalls the discard route entry for redistributed summarized routes on an Autonomous System Boundary Router (ASBR).

internal

(Optional) Reinstalls the discard-route entry for summarized internal routes on the Area Border Router (ABR).


Defaults

External and internal discard route entries are installed.

Command Modes

Router configuration

Command History

Release
Modification

12.1(1)T

This command was introduced.


Usage Guidelines

External and internal discard route entries are installed in routing tables by default. During route summarization, routing loops may occur when data is sent to a nonexisting network that appears to be a part of the summary, and the router performing the summarization has a less specific route (pointing back to the sending router) for this network in its routing table. To prevent the routing loop, a discard route entry is installed in the routing table of the ABR or ASBR.

If for any reason you do not want to use the external or internal discard route, remove the discard route by entering the no discard-route command with either the external or internal keyword.

Examples

The following display shows the discard route functionality installed by default. When external or internal routes are summarized, a summary route to Null0 will appear in the router output from the show ip route command. See the router output lines that appear in bold font:

Router# show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

      172.16.0.0/24 is variably subnetted, 3 subnets, 2 masks
C        172.16.0.128/25 is directly connected, Loopback1
O        172.16.0.0/24 is a summary, 00:00:14, Null0
C        172.16.0.0/25 is directly connected, Loopback0
      172.31.0.0/24 is variably subnetted, 3 subnets, 2 masks
C        172.31.0.128/25 is directly connected, Loopback3
O        172.31.0.0/24 is a summary, 00:00:02, Null0
C        172.31.0.0/25 is directly connected, Loopback2
C     192.168.0.0/24 is directly connected, Ethernet0/0

RouterB# show ip route ospf

      172.16.0.0/24 is variably subnetted, 3 subnets, 2 masks
O        172.16.0.0/24 is a summary, 00:00:29, Null0
      172.16.0.0/24 is variably subnetted, 3 subnets, 2 masks
O        201.0.0.0/24 is a summary, 00:00:17, Null0


When the no discard-route command with the internal keyword is entered, notice the following route change, indicated by the router output lines that appear in bold font:

RouterB# configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.
RouterB(config)# router ospf 1
RouterB(config-router)# no discard-route internal 
RouterB(config-router)#end

RouterB# show ip route ospf

      172.31.0.0/24 is variably subnetted, 3 subnets, 2 masks
O        172.16.0.0/24 is a summary, 00:04:14, Null0

Next, the no discard-route command with the external keyword is entered to remove the external discard route entry:

RouterB# configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.
RouterB(config)# router ospf 1
RouterB(config-router)# no discard-route external 
RouterB(config-router)# end

The following router output from the show running-config command confirms that both the external and internal discard routes have been removed from the routing table of RouterB. See the router output lines that appear in bold font:

RouterB# show running-config

Building configuration...

Current configuration : 1114 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname RouterB
.
.
.
router ospf 1
  log-adjacency-changes
 no discard-route external
 no discard-route internal
 area 1 range 172.16.0.0 255.255.255.0
 summary-address 172.31.0.0 255.255.255.0
 redistribute rip subnets
 network 192.168.0.0 0.0.0.255 area 0
 network 172.16.0.0 0.0.0.255 area 1
!

Related Commands

Command
Description

show ip route

Displays the current state of the routing table.

show running-config

Displays the contents of the currently running configuration file or the configuration for a specific interface, or map class information.


distance ospf

To define OSPF route administrative distances based on route type, use the distance ospf command in router configuration mode. To restore the default value, use the no form of this command.

distance ospf {[intra-area dist1] [inter-area dist2] [external dist3]}

no distance ospf

Syntax Description

intra-area dist1

(Optional) Sets the distance for all routes within an area. The default value is 110.

inter-area dist2

(Optional) Sets the distance for all routes from one area to another area. The default value is 110.

external dist3

(Optional) Sets the distance for routes from other routing domains, learned by redistribution. The default value is 110.


Defaults

dist1: 110

dist2: 110

dist3: 110

Command Modes

Router configuration

Command History

Release
Modification

11.1(14)

This command was introduced.


Usage Guidelines

You must specify at least one of the keyword-argument pairs.

This command performs the same function as the distance command used with an access list. However, the distance ospf command allows you to set a distance for an entire group of routes, rather than a specific route that passes an access list.

A common reason to use the distance ospf command is when you have multiple OSPF processes with mutual redistribution, and you want to prefer internal routes from one over external routes from the other.

Examples

The following example changes the external distance to 200, making the route less reliable:

Router A Configuration

router ospf 1
 redistribute ospf 2 subnet
 distance ospf external 200
!
router ospf 2
 redistribute ospf 1 subnet
 distance ospf external 200

Router B Configuration

router ospf 1 
 redistribute ospf 2 subnet
 distance ospf external 200 
! 
router ospf 2
 redistribute ospf 1 subnet
 distance ospf external 200

Related Commands

Command
Description

distance (IP)

Defines an administrative distance.


domain-tag

To set the Open Shortest Path First (OSPF) domain tag value for Type-5 or Type-7 link-state advertisements (LSAs) when OSPF is used as a protocol between a provider edge (PE) router and customer edge (CE) router, use the domain-tag command in router configuration mode. To reinstate the default tag value, use the no form of this command.