- Table of Contents
-
- 03-IP Routing Volume
- 00-IP Routing Volume Organization
- 01-IP Routing Table Display Commands
- 02-Static Routing Commands
- 03-RIP Commands
- 04-OSPF Commands
- 05-IS-IS Commands
- 06-BGP Commands
- 07-IPv6 Static Routing Commands
- 08-IPv6 RIPng Commands
- 09-IPv6 OSPFv3 commands
- 10-IPv6 IS-IS Commands
- 11-IPv6 BGP Commands
- 12-Route Policy Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
04-OSPF Commands | 230.04 KB |
Table of Contents
bandwidth-reference (OSPF view)
default-route-advertise (OSPF view)
description (OSPF/OSPF area view)
enable out-of-band-resynchronization
filter-policy export (OSPF view)
filter-policy import (OSPF view)
graceful-restart interval (OSPF view)
maximum load-balancing (OSPF view)
ospf packet-process prioritized-treatment
The term “router” in this document refers to a router in a generic sense or a Layer 3 switch.
OSPF Configuration Commands
abr-summary (OSPF area view)
Syntax
abr-summary ip-address { mask | mask-length } [ advertise | not-advertise ] [ cost cost ]
undo abr-summary ip-address { mask | mask-length }
View
OSPF area view
Default Level
2: System level
Parameters
ip-address: Destination IP address of the summary route, in dotted decimal format.
mask: Mask of the IP address in dotted decimal format.
mask-length: Mask length, in the range 0 to 32 bits.
advertise | not-advertise: Advertises the summary route or not. By default, the summary route is advertised.
cost cost: Specifies the cost of the summary route, in the range 1 to 16777215. The default cost is the largest cost value among routes that are summarized.
Description
Use the abr-summary command to configure a summary route on the area border router.
Use the undo abr-summary command to remove a summary route.
By default, no route summarization is configured on an ABR.
You can enable advertising the summary route or not, and specify a route cost.
This command is usable only on an ABR. Multiple contiguous networks may be available in an area, where you can summarize them into one network on the ABR for advertisement. The ABR advertises only the summary route to other areas.
With the undo abr-summary command used, summarized routes will be advertised.
Examples
# Summarize networks 36.42.10.0/24 and 36.42.110.0/24 in Area 1 into 36.42.0.0/16.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 1
[Sysname-ospf-100-area-0.0.0.1] network 36.42.10.0 0.0.0.255
[Sysname-ospf-100-area-0.0.0.1] network 36.42.110.0 0.0.0.255
[Sysname-ospf-100-area-0.0.0.1] abr-summary 36.42.0.0 255.255.0.0
area (OSPF view)
Syntax
area area-id
undo area area-id
View
OSPF view
Default Level
2: System level
Parameters
area-id: ID of an area, a decimal integer in the range 0 to 4294967295 that is translated into the IP address format by the system, or an IP address.
Description
Use the area command to create an area and enter area view.
Use the undo area command to remove a specified area.
No OSPF area is created by default.
Examples
# Create Area 0 and enter Area 0 view
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 0
[Sysname-ospf-100-area-0.0.0.0]
asbr-summary
Syntax
asbr-summary ip-address { mask | mask-length } [ tag tag | not-advertise | cost cost ] *
undo asbr-summary ip-address { mask | mask-length }
View
OSPF view
Default Level
2: System level
Parameters
ip-address: IP address of the summary route in dotted decimal notation.
mask: Summary route mask, in dotted decimal notation.
mask-length: Length of summary route mask, in the range 0 to 32 bits.
not-advertise: Disables advertising the summary route. If the keyword is not specified, the route is advertised.
tag tag: Specifies a tag value for the summary route, used by a route policy to control summary route advertisement, in the range 0 to 4294967295. The default is 1.
cost cost: Specifies the cost of the summary route, in the range 1 to 16777214. For Type-1 external routes, the cost defaults to the largest cost among routes that are summarized. For Type-2 external routes, the cost defaults to the largest cost among routes that are summarized plus 1.
Description
Use the asbr-summary command to configure a summary route.
Use the undo asbr-summary command to remove a summary route.
No ASBR route summarization is configured by default.
With the asbr-summary command configured on an ASBR, it summarizes redistributed routes that fall into the specified address range into a single route. If the ASBR resides in an NSSA area, it advertises the summary route in a Type-7 LSA into the area.
With the asbr-summary command configured on an NSSA ABR, it summarizes routes described by Type-5 LSAs translated from Type-7 LSAs into a single route and advertises the summary route to other areas. This command does not take effect on non NSSA ABRs.
With the undo asbr-summary command used, summarized routes will be advertised.
Related command: display ospf asbr-summary.
Examples
# Summarize redistributed routes into a single route, specifying a tag value of 2 and a cost of 100 for the summary route.
<Sysname> system-view
[Sysname] ip route-static 10.2.1.0 24 null 0
[Sysname] ip route-static 10.2.2.0 24 null 0
[Sysname] ospf 100
[Sysname-ospf-100] import-route static
[Sysname-ospf-100] asbr-summary 10.2.0.0 255.255.0.0 tag 2 cost 100
authentication-mode
Syntax
authentication-mode { simple | md5 }
undo authentication-mode
View
OSPF area view
Default Level
2: System level
Parameters
simple: Specifies the simple authentication mode.
md5: Specifies the MD5 ciphertext authentication mode.
Description
Use the authentication-mode command to specify an authentication mode for the OSPF area.
Use the undo authentication-mode command to remove the authentication mode.
By default, no authentication mode is configured for an OSPF area.
Routers that reside in the same area must have the same authentication mode: non-authentication, simple, or MD5.
Related commands: ospf authentication-mode.
Examples
# Configure OSPF area 0 to use the MD5 ciphertext authentication mode.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 0
[Sysname-ospf-100-area-0.0.0.0] authentication-mode md5
bandwidth-reference (OSPF view)
Syntax
bandwidth-reference value
undo bandwidth-reference
View
OSPF view
Default Level
2: System level
Parameters
value: Bandwidth reference value for link cost calculation, in the range 1 to 2147483648 Mbps.
Description
Use the bandwidth-reference command to specify a reference bandwidth value for link cost calculation.
Use the undo bandwidth-reference command to restore the default value.
The default value is 100 Mbps.
When links have no cost values configured, OSPF calculates their cost values: Cost=Reference bandwidth value / Link bandwidth. If the calculated cost is greater than 65535, the value of 65535 is used.
Examples
# Specify the reference bandwidth value as 1000 Mbps.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] bandwidth-reference 1000
default
Syntax
default { cost cost | limit limit | tag tag | type type } *
undo default { cost | limit | tag | type } *
View
OSPF view
Default Level
2: System level
Parameters
cost: Specifies the default cost for redistributed routes, in the range 0 to 16777214.
limit: Specifies the default upper limit of routes redistributed per time, in the range 1 to 2147483647.
tag: Specifies the default tag for redistributed routes, in the range 0 to 4294967295.
type: Specifies the default type for redistributed routes: 1 or 2.
Description
Use the default command to configure default parameters for redistributed routes.
Use the undo default command to restore default values.
The cost, route type, tag, and the upper limit are 1, 2, 1 and 1000 by default.
Related commands: import-route.
Examples
# Configure the default cost, upper limit, tag and type as 10, 20000, 100 and 2 respectively for redistributed external routes.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] default cost 10 limit 20000 tag 100 type 2
default-cost (OSPF area view)
Syntax
default-cost cost
undo default-cost
View
OSPF area view
Default Level
2: System level
Parameters
cost: Specifies a cost for the default route advertised to the Stub or NSSA area, in the range 0 to 16777214.
Description
Use the default-cost command to configure a cost for the default route advertised to the stub or NSSA area.
Use the undo default-cost command to restore the default value.
The cost defaults to 1.
This command is only applicable to the ABR of a stub area or the ABR/ASBR of an NSSA area.
Related commands: stub, nssa.
Examples
# Configure Area 1 as a stub area, and specify the cost of the default route advertised to the stub area as 20.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 1
[Sysname-ospf-100-area-0.0.0.1] stub
[Sysname-ospf-100-area-0.0.0.1] default-cost 20
default-route-advertise (OSPF view)
Syntax
default-route-advertise [ [ always | cost cost | type type | route-policy route-policy-name ] * | summary cost cost ]
undo default-route-advertise
View
OSPF view
Default Level
2: System level
Parameters
always: Generates a default route in an ASE LSA into the OSPF routing domain regardless of whether a default route exists in the routing table. Without this keyword used, the command can distribute a default route in a Type-5 LSA into the OSPF routing domain only when a default route exists in the routing table.
cost cost: Specifies a cost for the default route, in the range 0 to 16777214. If no cost is specified, the default cost specified by the default cost command applies..
type type: Specifies a type for the ASE LSA: 1 or 2. If type is not specified, the default type for the ASE LSA specified by the default type command applies..
route-policy route-policy-name: Specifies a route policy name, a string of 1 to 19 characters. If the default route matches the specified route policy, the route policy modifies some values in the ASE LSA.
summary: Advertises the Type-3 summary LSA of the specified default route.
Description
Use the default-route-advertise command to generate a default route into the OSPF routing domain.
Use the undo default-route-advertise command to disable OSPF from distributing a default external route.
By default, no default route is distributed.
Using the import-route command cannot redistribute a default route. To do so, use the default-route-advertise command. If no default route exists in the router's routing table, use the default-route-advertise always command to generate a default route in a Type-5 LSA.
The default-route-advertise summary cost command is applicable only to VPNs, and the default route is redistributed in a Type-3 LSA. The PE router advertises the redistributed default route to the CE router.
Related commands: import-route, default.
Examples
# Generate a default route in an ASE LSA into the OSPF routing domain (no default route configured on the router), regardless of whether the default route is available in the routing table.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] default-route-advertise always
description (OSPF/OSPF area view)
Syntax
description description
undo description
View
OSPF view/OSPF area view
Default Level
2: System level
Parameters
description: Configures a description for the OSPF process in OSPF view, or for the OSPF area in OSPF area view. description is a string of up to 80 characters.
Description
Use the description command to configure a description for an OSPF process or area.
Use the undo description command to remove the description.
No description is configured by default.
Use of this command is only for the identification of an OSPF process or area. The description has no special meaning.
Examples
# Describe the OSPF process 100 as abc.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] description abc
# Describe the OSPF area0 as bone area.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 0
[Sysname-ospf-100-area-0.0.0.0] description bone area
display ospf abr-asbr
Syntax
display ospf [ process-id ] abr-asbr
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535. Use this argument to display information about the routes to the ABR/ASBR under the specified OSPF process.
Description
Use the display ospf abr-asbr command to display information about the routes to OSPF ABR/ASBR.
If you use this command on routers in a stub area, no ASBR information is displayed.
Examples
# Display information about the routes to the OSPF ABR and ASBR.
<Sysname> display ospf abr-asbr
OSPF Process 1 with Router ID 192.168.1.2
Routing Table to ABR and ASBR
Type Destination Area Cost Nexthop RtType
Inter 3.3.3.3 0.0.0.0 3124 10.1.1.2 ASBR
Intra 2.2.2.2 0.0.0.0 1562 10.1.1.2 ABR
Table 1-1 display ospf abr-asbr command output description
Field |
Description |
Type |
Type of the route to the ABR or ASBR: l Intra: intra-area route l Inter: Inter-area route |
Destination |
Router ID of an ABR/ASBR |
Area |
ID of the area of the next hop |
Cost |
Cost from the router to the ABR/ASBR |
Nexthop |
Next hop address |
RtType |
Router type: ABR, ASBR |
display ospf asbr-summary
Syntax
display ospf [ process-id ] asbr-summary [ ip-address { mask | mask-length } ]
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
ip-address: IP address, in dotted decimal format.
mask: IP address mask, in dotted decimal format.
mask-length: Mask length, in the range 0 to 32 bits.
Description
Use the display ospf asbr-summary command to display information about the redistributed routes that are summarized.
If no OSPF process is specified, related information of all OSPF processes is displayed.
If no IP address is specified, information about all summarized redistributed routes will be displayed.
Related commands: asbr-summary.
Examples
# Display information about all summarized redistributed routes.
<Sysname> display ospf asbr-summary
OSPF Process 1 with Router ID 2.2.2.2
Summary Addresses
Total Summary Address Count: 1
Summary Address
Net : 30.1.0.0
Mask : 255.255.0.0
Tag : 20
Status : Advertise
Cost : 10 (Configured)
The Count of Route is : 2
Destination Net Mask Proto Process Type Metric
30.1.2.0 255.255.255.0 OSPF 1 2 1
30.1.1.0 255.255.255.0 OSPF 1 2 1
Table 1-2 display ospf asbr-summary command output description
Field |
Description |
Total Summary Address Count |
Total summary route number |
Net |
The address of the summary route |
Mask |
The mask of the summary route address |
Tag |
The tag of the summary route |
Status |
The advertisement status of the summary route |
Cost |
The cost to the summary net |
The Count of Route |
The count of routes that are summarized |
Destination |
Destination address of a summarized route |
Net Mask |
Network mask of a summarized route |
Proto |
Routing protocol |
Process |
Process ID of routing protocol |
Type |
Type of a summarized route |
Metric |
Metric of a summarized route |
display ospf brief
Syntax
display ospf [ process-id ] brief
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
Description
Use the display ospf brief command to display OSPF brief information. If no OSPF process is specified, brief information about all OSPF processes is displayed.
Examples
# Display OSPF brief information.
<Sysname> display ospf brief
OSPF Process 1 with Router ID 192.168.1.2
OSPF Protocol Information
RouterID: 192.168.1.2 Border Router: NSSA
Route Tag: 0
Multi-VPN-Instance is not enabled
Applications Supported: MPLS Traffic-Engineering
SPF-schedule-interval: 5 0 5000
LSA generation interval: 5 0 5000
LSA arrival interval: 1000
Transmit pacing: Interval: 20 Count: 3
Default ASE parameters: Metric: 1 Tag: 1 Type: 2
Route Preference: 10
ASE Route Preference: 150
SPF Computation Count: 22
RFC 1583 Compatible
Area Count: 1 Nssa Area Count: 1
ExChange/Loading Neighbors: 0
Area: 0.0.0.1 (MPLS TE not enabled)
Authtype: None Area flag: NSSA
SPF Scheduled Count: 5
ExChange/Loading Neighbors: 0
Interface: 192.168.1.2 (Vlan-interface1)
Cost: 1 State: DR Type: Broadcast MTU: 1500
Priority: 1
Designated Router: 192.168.1.2
Backup Designated Router: 192.168.1.1
Timers: Hello 10 , Dead 40 , Poll 40 , Retransmit 5 , Transmit Delay 1
Table 1-3 display ospf brief command output description
Field |
Description |
OSPF Process 1 with Router ID 192.168.1.2 |
OSPF process ID and OSPF router ID |
RouterID |
Router ID |
Border Router |
Whether the router is a boarder router: l ABR l ASBR l NSSA ABR |
Route Tag |
The tag of redistributed routes |
Multi-VPN-Instance is not enabled |
The OSPF process does not support multi-VPN-instance. |
Applications Supported |
Applications supported. MPLS Traffic-Engineering means MPLS TE is supported. |
SPF-schedule-interval |
Interval for SPF calculations |
LSA generation interval |
LSA generation interval |
LSA arrival interval |
Minimum LSA repeat arrival interval |
Transmit pacing |
LSU packet transmit rate of the interface: l Interval indicates the LSU transmit interval of the interface. l Count indicates the maximum number of LSU packets sent during each interval. |
Default ASE Parameter |
Default ASE Parameters: metric, tag, route type. |
Route Preference |
Internal route priority |
ASE Route Preference |
External route priority |
SPF Computation count |
SPF computation count of the OSPF process |
RFC1583 Compatible |
Compatible with routing rules defined in RFC1583 |
Area Count |
Area number of the current process |
Nssa Area Count |
NSSA area number of the current process |
ExChange/Loading Neighbors |
Neighbors in ExChange/Loading state |
Area |
Area ID in the IP address format |
Authtype |
Authentication type of the area: l None: Non-authentication l Simple: simple authentication l MD5: MD5 authentication |
Area flag |
The type of the area |
SPF scheduled Count |
SPF calculation count in the OSPF area |
Interface |
Interface in the area |
Cost |
Interface cost |
State |
Interface state |
Type |
Interface network type |
MTU |
Interface MTU |
Priority |
Router priority |
Designated Router |
The Designated Router |
Backup Designated Router |
The Backup Designated Router |
Timers |
Intervals of timers: hello, dead, poll, retransmit, and transmit delay |
display ospf cumulative
Syntax
display ospf [ process-id ] cumulative
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
Description
Use the display ospf cumulative command to display OSPF statistics.
Use of this command is helpful for troubleshooting.
Examples
# Display OSPF statistics.
<Sysname> display ospf cumulative
OSPF Process 1 with Router ID 2.2.2.2
Cumulations
IO Statistics
Type Input Output
Hello 61 122
DB Description 2 3
Link-State Req 1 1
Link-State Update 3 3
Link-State Ack 3 2
LSAs originated by this router
Router: 4
Network: 0
Sum-Net: 0
Sum-Asbr: 0
External: 0
NSSA: 0
Opq-Link: 0
Opq-Area: 0
Opq-As: 0
LSAs Originated: 4 LSAs Received: 7
Routing Table:
Intra Area: 2 Inter Area: 3 ASE/NSSA: 0
Table 1-4 display ospf cumulative command output description
Field |
Description |
IO statistics |
Statistics about input/output packets and LSAs |
Type |
OSPF packet type |
Input |
Packets received |
Output |
Packets sent |
Hello |
Hell packet |
DB Description |
Database Description packet |
Link-State Req |
Link-State Request packet |
Link-State Update |
Link-State Update packet |
Link-State Ack |
Link-State Acknowledge packet |
LSAs originated by this router |
LSAs originated by this router |
Router |
Number of Type-1 LSAs originated |
Network |
Number of Type-2 LSAs originated |
Sum-Net |
Number of Type-3 LSAs originated |
Sum-Asbr |
Number of Type-4 LSAs originated |
External |
Number of Type-5 LSAs originated |
NSSA |
Number of Type-7 LSAs originated |
Opq-Link |
Number of Type-9 LSAs originated |
Opq-Area |
Number of Type-10 LSAs originated |
Opq-As |
Number of Type-11 LSAs originated |
LSA originated |
Number of LSAs originated |
LSA Received |
Number of LSAs received |
Routing Table |
Routing table information |
Intra Area |
Intra-area route number |
Inter Area |
Inter-area route number |
ASE |
ASE route number |
display ospf error
Syntax
display ospf [ process-id ] error
View
Anyview
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
Description
Use the display ospf error command to display OSPF error information.
If no process is specified, the OSPF error information of all OSPF processes is displayed.
Examples
# Display OSPF error information.
<Sysname> display ospf error
OSPF Process 1 with Router ID 192.168.80.100
OSPF Packet Error Statistics
0 : OSPF Router ID confusion 0 : OSPF bad packet
0 : OSPF bad version 0 : OSPF bad checksum
0 : OSPF bad area ID 0 : OSPF drop on unnumber interface
0 : OSPF bad virtual link 0 : OSPF bad authentication type
0 : OSPF bad authentication key 0 : OSPF packet too small
0 : OSPF Neighbor state low 0 : OSPF transmit error
0 : OSPF interface down 0 : OSPF unknown neighbor
0 : HELLO: Netmask mismatch 0 : HELLO: Hello timer mismatch
0 : HELLO: Dead timer mismatch 0 : HELLO: Extern option mismatch
0 : HELLO: NBMA neighbor unknown 0 : DD: MTU option mismatch
0 : DD: Unknown LSA type 0 : DD: Extern option mismatch
0 : LS ACK: Bad ack 0 : LS ACK: Unknown LSA type
0 : LS REQ: Empty request 0 : LS REQ: Bad request
0 : LS UPD: LSA checksum bad 0 : LS UPD: Received less recent LSA
0 : LS UPD: Unknown LSA type
Table 1-5 display ospf error command output description
Field |
Description |
OSPF Router ID confusion |
Packets with duplicate route ID |
OSPF bad packet |
Packets illegal |
OSPF bad version |
Packets with wrong version |
OSPF bad checksum |
Packets with wrong checksum |
OSPF bad area ID |
Packets with invalid area ID |
OSPF drop on unnumber interface |
Packets dropped on the unnumbered interface |
OSPF bad virtual link |
Packets on wrong virtual links |
OSPF bad authentication type |
Packets with invalid authentication type |
OSPF bad authentication key |
Packets with invalid authentication key |
OSPF packet too small |
Packets too small in length |
OSPF Neighbor state low |
Packets received in low neighbor state |
OSPF transmit error |
Packets with error when being transmitted |
OSPF interface down |
Shutdown times of the interface |
OSPF unknown neighbor |
Packets received from unknown neighbors |
HELLO: Netmask mismatch |
Hello packets with mismatched mask |
HELLO: Hello timer mismatch |
Hello packets with mismatched hello timer |
HELLO: Dead timer mismatch |
Hello packets with mismatched dead timer |
HELLO: Extern option mismatch |
Hello packets with mismatched option field |
HELLO: NBMA neighbor unknown |
Hello packets received from unknown NBMA neighbors |
DD: MTU option mismatch |
DD packets with mismatched MTU |
DD: Unknown LSA type |
DD packets with unknown LSA type |
DD: Extern option mismatch |
DD packets with mismatched option field |
LS ACK: Bad ack |
Bad LSAck packets for LSU packets |
LS ACK: Unknown LSA type |
LSAck packets with unknown LSA type |
LS REQ: Empty request |
LSR packets with no request information |
LS REQ: Bad request |
Bad LSR packets |
LS UPD: LSA checksum bad |
LSU packets with wrong LSA checksum |
LS UPD: Received less recent LSA |
LSU packets without latest LSA |
LS UPD: Unknown LSA type |
LSU packets with unknown LSA type |
display ospf interface
Syntax
display ospf [ process-id ] interface [ all | interface-type interface-number ]
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
all: Display the OSPF information of all interfaces.
interface-type interface-number: Interface type and interface number.
Description
Use the display ospf interface command to display OSPF interface information.
If no OSPF process is specified, the OSPF interface information of all OSPF processes is displayed.
Examples
# Display OSPF interface information.
<Sysname> display ospf interface
OSPF Process 1 with Router ID 192.168.1.1
Interfaces
Area: 0.0.0.0
IP Address Type State Cost Pri DR BDR
192.168.1.1 PTP P-2-P 1562 1 0.0.0.0 0.0.0.0
Area: 0.0.0.1
IP Address Type State Cost Pri DR BDR
172.16.0.1 Broadcast DR 1 1 172.16.0.1 0.0.0.0
Table 1-6 display ospf interface command output description
Field |
Description |
Area |
Area ID of the interface |
IP address |
Interface IP address (regardless of whether TE is enabled or not) |
Type |
Interface network type: PTP, PTMP, Broadcast, or NBMA |
State |
Interface state defined by interface state machine: l DOWN: In this state, no protocol traffic will be sent or received on the interface. l Waiting: Means the interface starts sending and receiving Hello packets and the router is trying to determine the identity of the (Backup) designated router for the network. l p-2-p: Means the interface will send Hello packets at the interval of HelloInterval, and try to establish an adjacency with the neighbor. l DR: Means the router itself is the designated router on the attached network. l BDR: Means the router itself is the backup designated router on the attached network. l DROther: Means the interface is on a network on which another router has been selected as the designated router. |
Cost |
Interface cost |
Pri |
Router priority |
DR |
The DR on the interface’s network segment |
BDR |
The BDR on the interface’s network segment |
display ospf lsdb
Syntax
display ospf [ process-id ] lsdb [ brief | [ { ase | router | network | summary | asbr | nssa | opaque-link | opaque-area | opaque-as } [ link-state-id ] ] [ originate-router advertising-router-id | self-originate ] ]
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
brief: Displays brief LSDB information.
ase: Displays Type-5 LSA (AS External LSA) information in the LSDB.
router: Displays Type-1 LSA (Router LSA) information in the LSDB.
network: Displays Type-2 LSA (Network LSA) information in the LSDB.
summary: Displays Type-3 LSA (Network Summary LSA) information in the LSDB.
asbr: Displays Type-4 LSA (ASBR Summary LSA) information in the LSDB.
nssa: Displays Type-7 LSA (NSSA External LSA) information in the LSDB.
opaque-link: Displays Type-9 LSA (Opaque-link LSA) information in the LSDB.
opaque-area: Displays Type-10 LSA (Opaque-area LSA) information in the LSDB.
opaque-as: Displays Type-11 LSA (Opaque-AS LSA) information in the LSDB.
link-state-id: Link state ID, in the IP address format.
originate-router advertising-router-id: Displays information about LSAs originated by the specified router.
self-originate: Displays information about self-originated LSAs.
Description
Use the display ospf lsdb command to display LSDB information.
If no OSPF process is specified, LSDB information of all OSPF processes is displayed.
Examples
# Display OSPF LSDB information.
<Sysname> display ospf lsdb
OSPF Process 1 with Router ID 192.168.0.1
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 192.168.0.2 192.168.0.2 474 36 80000004 0
Router 192.168.0.1 192.168.0.1 21 36 80000009 0
Network 192.168.0.1 192.168.0.1 321 32 80000003 0
Sum-Net 192.168.1.0 192.168.0.1 321 28 80000002 1
Sum-Net 192.168.2.0 192.168.0.2 474 28 80000002 1
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 192.168.0.1 192.168.0.1 21 36 80000005 0
Sum-Net 192.168.2.0 192.168.0.1 321 28 80000002 2
Sum-Net 192.168.0.0 192.168.0.1 321 28 80000002 1
Table 1-7 display ospf lsdb command output description
Field |
Description |
Area |
LSDB information of the area |
Type |
LSA type |
LinkState ID |
Linkstate ID |
AdvRouter |
The router that advertised the LSA |
Age |
Age of the LSA |
Len |
Length of the LSA |
Sequence |
Sequence number of the LSA |
Metric |
Cost of the LSA |
# Display Type2 LSA (Network LSA) information in the LSDB.
<Sysname> display ospf 1 lsdb network
OSPF Process 1 with Router ID 192.168.1.1
Area: 0.0.0.0
Link State Database
Type : Network
LS ID : 192.168.0.2
Adv Rtr : 192.168.2.1
LS Age : 922
Len : 32
Options : E
Seq# : 80000003
Chksum : 0x8d1b
Net Mask : 255.255.255.0
Attached Router 192.168.1.1
Attached Router 192.168.2.1
Area: 0.0.0.1
Link State Database
Type : Network
LS ID : 192.168.1.2
Adv Rtr : 192.168.1.2
LS Age : 782
Len : 32
Options : NP
Seq# : 80000003
Chksum : 0x2a77
Net Mask : 255.255.255.0
Attached Router 192.168.1.1
Attached Router 192.168.1.2
Table 1-8 display ospf 1 lsdb network command output description
Field |
Description |
Type |
LSA type |
LS ID |
DR IP address |
Adv Rtr |
Router that advertised the LSA |
LS Age |
LSA age time |
Len |
LSA length |
Options |
LSA options: O: Opaque LSA advertisement capability E: AS External LSA reception capability EA: External extended LSA reception capability DC: On-demand link support N: NSSA external LSA support P: Capability of an NSSA ABR to translate Type-7 LSAs into Type-5 LSAs. |
Seq# |
LSA sequence number |
Chksum |
LSA checksum |
Net Mask |
Network mask |
Attached Router |
ID of the router that established adjacency with the DR, and ID of the DR itself |
display ospf nexthop
Syntax
display ospf [ process-id ] nexthop
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
Description
Use the display ospf nexthop command to display OSPF next hop information.
If no OSPF process is specified, the next hop information of all OSPF processes is displayed.
Examples
# Display OSPF next hop information.
<Sysname> display ospf nexthop
OSPF Process 1 with Router ID 192.168.0.1
Routing Nexthop Information
Next Hops:
Address Refcount IntfAddr Intf Name
----------------------------------------------------------------
192.168.0.1 1 192.168.0.1 Vlan-interface1
192.168.0.2 1 192.168.0.1 Vlan-interface1
192.168.1.1 1 192.168.1.1 Vlan-interface10
Table 1-9 display ospf nexthop command output description
Field |
Description |
Next hops |
Information about Next hops |
Address |
Next hop address |
Refcount |
Reference count, namely, routes that reference the next hop |
IntfAddr |
Outbound interface address |
Intf Name |
Outbound interface name |
display ospf peer
Syntax
display ospf [ process-id ] peer [ verbose | [ interface-type interface-number ] [ neighbor-id ] ]
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
verbose: Displays detailed neighbor information.
interface-type interface-number: Interface type and interface number.
neighbor-id: Neighbor router ID.
Description
Use the display ospf peer command to display information about OSPF neighbors.
Note that:
If no OSPF process is specified, OSPF neighbor information of all OSPF processes is displayed.
If an interface is specified, the neighbor on the interface is displayed.
If a neighbor ID is specified, detailed information about the neighbor is displayed,
If neither interface nor neighbor ID is specified, brief information about neighbors of the specified OSPF process or all OSPF processes is displayed.
Examples
# Display detailed OSPF neighbor information.
<Sysname> display ospf peer verbose
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 1.1.1.1(Vlan-interface1)'s neighbors
Router ID: 1.1.1.2 Address: 1.1.1.2 GR State: Normal
State: Full Mode: Nbr is Master Priority: 1
DR: 1.1.1.2 BDR: 1.1.1.1 MTU: 0
Dead timer due in 33 sec
Neighbor is up for 02:03:35
Authentication Sequence: [ 0 ]
Neighbor state change count: 6
Table 1-10 display ospf peer verbose command output description
Field |
Description |
Area areaID interface IPAddress(InterfaceName)'s neighbors |
Neibghor information of the interface in the specified area: l areaID: Area to which the neighbor belongs. l IPAddress: Initerface IP address l InterfaceName: Interface name |
interface |
Interface attached with the neighbor |
Router ID |
Neighbor router ID |
Address |
Neighbor router address |
GR State |
GR state |
State |
Neighbor state: l Down: This is the initial state of a neighbor conversation. l Init: In this state, the router has seen a Hello packet from the neighbor. However, the router has not established bidirectional communication with the neighbor (the router itself did not appear in the neighbor's hello packet). l Attempt: Available only in an NBMA network, Under this state, the OSPF router has not received any information from a neighbor for a period but can send Hello packets with a longer interval to keep neighbor relationship. l 2-Way: In this state, communication between the two routers is bidirectional. The router itself appears in the neighbor's Hello packet. l Exstart: The goal of this state is to decide which router is the master, and to decide upon the initial Database Description (DD) sequence number. l Exchange: In this state, the router is sending DD packets to the neighbor, describing its entire link-state database. l Loading: In this state, the router sends Link State Request packets to the neighbor, requesting more recent LSAs. l Full: In this state, the neighboring routers are fully adjacent. |
Mode |
Neighbor mode for LSDB synchronization: l Nbr is Master: Means the neighboring router is the master. l Nbr is Slave: Means the neighboring router is the slave. |
Priority |
Neighboring router priority |
DR |
The DR on the interface’s network segment |
BDR |
The BDR on the interface’s network segment |
MTU |
Interface MTU |
Dead timer due in 33 sec |
Dead timer times out in 33 seconds |
Neighbor is up for 02:03:35 |
The neighbor has been up for 02:03:35. |
Authentication Sequence |
Authentication sequence number |
Neighbor state change count |
Count of neighbor state changes |
# Display brief OSPF neighbor information.
<Sysname> display ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbor Brief Information
Area: 0.0.0.0
Router ID Address Pri Dead-Time Interface State
1.1.1.2 1.1.1.2 1 40 Vlan1 Full/DR
Table 1-11 display ospf peer command output description
Field |
Description |
Area |
Neighbor area |
Router ID |
Neighbor router ID |
Address |
Neighbor interface address |
Pri |
Neighboring router priority |
Dead time(s) |
Dead interval remained |
Interface |
Interface connected to the neighbor |
State |
Neighbor state: Down, Init, Attempt, 2-Way, Exstart, Exchange, Loading or Full |
display ospf peer statistics
Syntax
display ospf [ process-id ] peer statistics
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
Description
Use the display ospf peer statistics command to display OSPF neighbor statistics.
If no OSPF process is specified, OSPF neighbor statistics of all OSPF processes is displayed.
Examples
# Display OSPF neighbor statistics.
<Sysname> display ospf peer statistics
OSPF Process 1 with Router ID 10.3.1.1
Neighbor Statistics
Area ID Down Attempt Init 2-Way ExStart Exchange Loading Full Total
0.0.0.0 0 0 0 0 0 0 0 1 1
0.0.0.2 0 0 0 0 0 0 0 1 1
Total 0 0 0 0 0 0 0 2 2
Table 1-12 display ospf peer statistics command output description
Field |
Description |
Area ID |
Area ID. The state statistics information of all the routers in the area to which the router belongs is displayed. |
Down |
Number of neighboring routers in the Down state in the same area |
Attempt |
Number of neighboring routers in the Attempt state in the same area |
Init |
Number of neighboring routers in the Init state in the same area |
2-Way |
Number of neighboring routers in the 2-Way state in the same area |
ExStart |
Number of neighboring routers in the ExStart state in the same area |
Exchange |
Number of neighboring routers in the Exchange state in the same area |
Loading |
Number of neighboring routers in the Loading state in the same area |
Full |
Number of neighboring routers in the Full state in the same area |
Total |
Total number of neighbors under the same state, namely, Down, Attempt, Init, 2-Way, ExStart, Loading, or Full. |
display ospf request-queue
Syntax
display ospf [ process-id ] request-queue [ interface-type interface-number ] [ neighbor-id ]
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
interface-type interface-number: Interface type and number.
neighbor-id: Neighbor’s router ID.
Description
Use the display ospf request-queue command to display OSPF request queue information.
If no OSPF process is specified, the OSPF request queue information of all OSPF processes is displayed.
Examples
# Display OSPF request queue information.
<Sysname> display ospf request-queue
OSPF Process 1 with Router ID 1.1.1.1
OSPF Request List
The Router's Neighbor is Router ID 2.2.2.2 Address 10.1.1.2
Interface 10.1.1.1 Area 0.0.0.0
Request list:
Type LinkState ID AdvRouter Sequence Age
Router 2.2.2.2 1.1.1.1 80000004 1
Network 192.168.0.1 1.1.1.1 80000003 1
Sum-Net 192.168.1.0 1.1.1.1 80000002 2
Table 1-13 display ospf request queue command output description
Field |
Description |
The Router's Neighbor is Router ID |
Neighbor router ID |
Address |
Neighbor interface IP address |
Interface |
Local interface IP address |
Area |
Area ID |
Request list |
Request list information |
Type |
LSA type |
LinkState ID |
Link state ID |
AdvRouter |
Advertising router |
Sequence |
LSA sequence number |
Age |
LSA age |
display ospf retrans-queue
Syntax
display ospf [ process-id ] retrans-queue [ interface-type interface-number ] [ neighbor-id ]
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
interface-type interface-number: Interface type and interface number.
neighbor-id: Neighbor’s router ID.
Description
Use the display ospf retrans-queue command to display retransmission queue information.
If no OSPF process is specified, the retransmission queue information of all OSPF processes is displayed.
Examples
# Display OSPF retransmission queue information.
<Sysname> display ospf retrans-queue
OSPF Process 1 with Router ID 1.1.1.1
OSPF Retransmit List
The Router's Neighbor is Router ID 2.2.2.2 Address 10.1.1.2
Interface 10.1.1.1 Area 0.0.0.0
Retransmit list:
Type LinkState ID AdvRouter Sequence Age
Router 2.2.2.2 2.2.2.2 80000004 1
Network 12.18.0.1 2.2.2.2 80000003 1
Sum-Net 12.18.1.0 2.2.2.2 80000002 2
Table 1-14 display ospf retrans-queue command output description
Field |
Description |
The Router's Neighbor is Router ID |
Neighbor router ID |
Address |
Neighbor interface IP address |
Interface |
Interface address of the router |
Area |
Area ID |
Retrans List |
Retransmission list |
Type |
LSA type |
LinkState ID |
Link state ID |
AdvRouter |
Advertising router |
Sequence |
LSA sequence number |
Age |
LSA age |
display ospf routing
Syntax
display ospf [ process-id ] routing [ interface interface-type interface-number ] [ nexthop nexthop-address ]
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
interface interface-type interface-number: Displays OSPF routing information advertised via the interface.
nexthop nexthop-address: Displays OSPF routing information with the specified next hop.
Description
Use the display ospf routing command to display OSPF routing information.
If no OSPF process is specified, the routing information of all OSPF processes is displayed.
Examples
# Display OSPF routing information.
<Sysname> display ospf routing
OSPF Process 1 with Router ID 192.168.1.2
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
192.168.1.0/24 1562 Stub 192.168.1.2 192.168.1.2 0.0.0.0
172.16.0.0/16 1563 Inter 192.168.1.1 192.168.1.1 0.0.0.0
Total Nets: 2
Intra Area: 1 Inter Area: 1 ASE: 0 NSSA: 0
Table 1-15 display ospf routing command output description
Field |
Description |
Destination |
Destination network |
Cost |
Cost to destination |
Type |
Route type: intra-area, transit, stub, inter-area, type1 external, type2 external. |
NextHop |
Next hop address |
AdvRouter |
Advertising router |
Area |
Area ID |
Total Nets |
Total networks |
Intra Area |
Total intra-area routes |
Inter Area |
Total inter-area routes |
ASE |
Total ASE routes |
NSSA |
Total NSSA routes |
display ospf vlink
Syntax
display ospf [ process-id ] vlink
View
Any view
Default Level
1: Monitor level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
Description
Use the display ospf vlink command to display OSPF virtual link information.
If no OSPF process is specified, the OSPF virtual link information of all OSPF processes is displayed.
Examples
# Display OSPF virtual link information.
<Sysname> display ospf vlink
OSPF Process 1 with Router ID 3.3.3.3
Virtual Links
Virtual-link Neighbor-ID -> 2.2.2.2, Neighbor-State: Full
Interface: 10.1.2.1 (Vlan-interface1)
Cost: 1562 State: P-2-P Type: Virtual
Transit Area: 0.0.0.1
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
Table 1-16 display ospf vlink command output description
Field |
Description |
Virtual-link Neighbor-id |
ID of the neighbor connected to the router via the virtual link |
Neighbor-State |
Neighbor State: Down, Init, 2-Way, ExStart, Exchange, Loading, Full. |
Interface |
Local interface’s IP address and name of the virtual link |
Cost |
Interface route cost |
State |
Interface state |
Type |
Type: virtual link |
Transit Area |
Transit area ID |
Timers |
Values of timers: hello, dead, poll (NBMA), retransmit, and interface transmission delay |
enable link-local-signaling
Syntax
enable link-local-signaling
undo enable link-local-signaling
View
OSPF view
Default Level
2: System level
Parameters
None
Description
Use the enable link-local-signaling command to enable the OSPF link-local signaling (LLC) capability.
Use the undo enable link-local-signaling command to disable the OSPF link-local signaling capability.
By default, this capability is disabled.
Examples
# Enable link-local signaling for OSPF process 1.
<Sysname> system-view
[Sysname] ospf 1
[Sysname-ospf-1] enable link-local-signaling
enable log
Syntax
enable log [ config | error | state ]
undo enable log [ config | error | state ]
View
OSPF view
Default Level
2: System level
Parameters
config: Enables configuration logging.
error: Enables error logging.
state: Enables state logging.
Description
Use the enable command to enable specified OSPF logging.
Use the undo enable command to disable specified OSPF logging.
OSPF logging is disabled by default.
If no keyword is specified, all logging is enabled.
Examples
# Enable OSPF logging.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] enable log
enable out-of-band-resynchronization
Syntax
enable out-of-band-resynchronization
undo enable out-of-band-resynchronization
View
OSPF view
Default Level
2: System level
Parameters
None
Description
Use the enable out-of-band-resynchronization command to enable the OSPF out-of-band resynchronization (OOB-Resynch) capability.
Use the undo enable out-of-band-resynchronization command to disable the OSPF out-of-band resynchronization capability.
By default, the capability is disabled.
Examples
# Enable the out-of-band resynchronization capability for OSPF process 1.
<Sysname> system-view
[Sysname] ospf 1
[Sysname-ospf-1] enable link-local-signaling
[Sysname-ospf-1] enable out-of-band-resynchronization
filter
Syntax
filter { acl-number | ip-prefix ip-prefix-name } { import | export }
undo filter { import | export }
View
OSPF area view
Default Level
2: System level
Parameters
acl-number: ACL number, in the range 2000 to 3999.
ip-prefix-name: IP prefix list name, a string of up to 19 characters. For details about IP prefix lists, see Route Policy Configuration in the IP Routing Volume.
import: Filters Type-3 LSAs advertised into the area.
export: Filters Type-3 LSAs advertised to other areas.
Description
Use the filter command to configure incoming/outgoing Type-3 LSAs filtering on an ABR.
Use the undo filter command to disable Type-3 LSA filtering.
By default, Type-3 LSAs filtering is disabled.
This command is only available on an ABR.
Examples
# Apply IP prefix list my-prefix-list to filter inbound Type-3 LSAs, and apply ACL 2000 to filter outbound Type-3 LSAs in OSPF Area 1.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 1
[Sysname-ospf-100-area-0.0.0.1] filter ip-prefix my-prefix-list import
[Sysname-ospf-100-area-0.0.0.1] filter 2000 export
filter-policy export (OSPF view)
Syntax
filter-policy { acl-number | ip-prefix ip-prefix-name } export [ protocol [ process-id ] ]
undo filter-policy export [ protocol [ process-id ] ]
View
OSPF view
Default Level
2: System level
Parameters
acl-number: Number of an ACL used to filter redistributed routes, in the range 2000 to 3999.
ip-prefix-name: Name of an IP prefix list used to filter redistributed routes, a string of up to 19 characters.
protocol: Specifies a protocol from which to filter redistributed routes. The protocol can be direct, static, rip, ospf, isis or bgp. If no protocol is specified, all redistributed routes are filtered.
process-id: Process ID, which is required when the protocol is rip, ospf or isis, in the range 1 to 65535.
Description
Use the filter-policy export command to configure the filtering of redistributed routes.
Use the undo filter-policy export command to disable the filtering.
By default, the filtering of redistributed routes is not configured.
You can use this command to filter redistributed routes as needed.
Related commands: import-route.
Examples
# Filter redistributed routes using ACL2000.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] filter-policy 2000 export
filter-policy import (OSPF view)
Syntax
filter-policy { acl-number | ip-prefix ip-prefix-name | gateway ip-prefix-name } import
undo filter-policy import
View
OSPF view
Default Level
2: System level
Parameters
acl-number: Number of an ACL used to filter incoming routes, in the range 2000 to 3999.
ip-prefix-name: Name of an IP address prefix list used to filter incoming routes based on destination IP address, a string of up to 19 characters. For details about IP prefix lists, refer to Route Policy Configuration in the IP Routing Volume.
gateway ip-prefix-name: Name of an IP address prefix list used to filter routes based on the next hop of the routing information, a string of up to 19 characters.
Description
Use the filter-policy import command to configure the filtering of routes calculated from received LSAs.
Use the undo filter-policy import command to disable the filtering.
By default, the filtering is not configured.
Examples
# Filter incoming routes using ACL2000.
<Sysname> system-view
[Sysname] acl number 2000
[Sysname-acl-basic-2000] rule permit source 192.168.10.0 0.0.0.255
[Sysname-acl-basic-2000] quit
[Sysname] ospf 100
[Sysname-ospf-100] filter-policy 2000 import
graceful-restart (OSPF view)
Syntax
graceful-restart [ nonstandard | ietf ]
undo graceful-restart
View
OSPF view
Default Level
2: System level
Parameters
nonstandard: Enables the non-IETF GR capability.
ietf: Enables the IETF GR capability.
Description
Use the graceful-restart command to enable OSPF Graceful Restart capability.
Use the undo graceful-restart command to disable OSPF Graceful Restart capability.
By default, OSPF Graceful Restart capability is disabled.
Note the following:
l Enable Opaque LSA advertisement and reception with the opaque-capability enable command before enabling the IETF GR capability for OSPF.
l Before enabling non-IETF GR capability for OSPF, enable OSPF LLS (link local signaling) with the enable link-local-signaling command and OOB (out of band resynchronization) with the enable out-of-band-resynchronization command.
l If the keywords nonstandard and ietf are not specified when OSPF GR is enabled, nonstandard is the default.
Related commands: enable link-local-signaling, enable out-of-band-resynchronization, opaque-capability enable.
Examples
# Enable IETF Graceful Restart for OSPF process 1.
<Sysname> system-view
[Sysname] ospf 1
[Sysname-ospf-1] opaque-capability enable
[Sysname-ospf-1] graceful-restart ietf
# Enable non-IETF Graceful Restart for OSPF process 1.
<Sysname> system-view
[Sysname] ospf 1
[Sysname-ospf-1] enable link-local-signaling
[Sysname-ospf-1] enable out-of-band-resynchronization
[Sysname-ospf-1] graceful-restart nonstandard
graceful-restart help
Syntax
graceful-restart help { acl-number | prefix prefix-list }
undo graceful-restart help
View
OSPF view
Default Level
2: System level
Parameters
acl-number: Basic or advanced ACL number, in the range 2000 to 3999.
prefix-list: Name of the specified IP prefix list, a string of 1 to 19 characters.
Description
Use the graceful-restart help command to configure for which OSPF neighbors the current router can serve as a GR Helper. (The neighbors are specified by the ACL or the IP prefix list.)
Use the undo graceful-restart help command to restore the default.
By default, the router can serve as a GR Helper for any OSPF neighbor.
Examples
# Enable IETF standard GR for OSPF process 1 and configure the router as a GR Helper for OSPF neighbors defined in the ACL 2001.
<Sysname> system-view
[Sysname] ospf 1
[Sysname-ospf-1] opaque-capability enable
[Sysname-ospf-1] graceful-restart help 2001
# Enable non IETF standard GR for OSPF process 1 and configure the router as a GR Helper for OSPF neighbors defined in the ACL 2001.
<Sysname> system-view
[Sysname] ospf 1
[Sysname-ospf-1] enable link-local-signaling
[Sysname-ospf-1] enable out-of-band-resynchronization
[Sysname-ospf-1] graceful-restart help 2001
graceful-restart interval (OSPF view)
Syntax
graceful-restart interval interval-value
undo graceful-restart interval
View
OSPF view
Default Level
2: System level
Parameters
interval-value: Specifies the Graceful Restart interval, in the range 40 to 1,800 seconds.
Description
Use the graceful-restart interval command to configure the Graceful Restart interval.
Use the undo graceful-restart interval command to restore the default Graceful Restart interval.
By default, the Graceful Restart interval is 120 seconds.
Note that the Graceful Restart interval of OSPF cannot be less than the maximum value of dead intervals on all OSPF interfaces; otherwise, the Graceful Restart of OSPF may fail.
Related commands: ospf timer dead.
Examples
# Configure the Graceful Restart interval for OSPF process 1 as 100 seconds.
<Sysname> system-view
[Sysname] ospf 1
[Sysname-ospf-1] graceful-restart interval 100
host-advertise
Syntax
host-advertise ip-address cost
undo host-advertise ip-address
View
OSPF area view
Default Level
2: System level
Parameters
ip-address: IP address of a host
cost: Cost of the route, in the range 1 to 65535.
Description
Use the host-advertise command to advertise a host route.
Use the undo host-advertise command to remove a host route.
No host route is advertised by default.
Examples
# Advertise route 1.1.1.1 with a cost of 100.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 0
[Sysname-ospf-100-area-0.0.0.0]host-advertise 1.1.1.1 100
import-route (OSPF view)
Syntax
import-route protocol [ process-id | all-processes | allow-ibgp ] [ cost cost | type type | tag tag | route-policy route-policy-name ] *
undo import-route protocol [ process-id | all-processes ]
View
OSPF view
Default Level
2: System level
Parameters
protocol: Redistributes routes from the specified protocol, which can be bgp, direct, isis, ospf, rip, or static.
process-id: Process ID, in the range 1 to 65535. The default is 1. It is available only when the protocol is rip, ospf, or isis.
all-processes: Redistributes routes from all the processes of the specified routing protocol. This keyword takes effect only when the protocol is rip, ospf, or isis.
allow-ibgp: Allows IBGP routes redistribution. It is optional only when the protocol is bgp.
cost cost: Specifies a route cost, in the range 0 to 16777214. The default is 1.
type type: Specifies a cost type, 1 or 2. The default is 2.
tag tag : Specifies a tag for external LSAs. The default is 1.
route-policy route-policy-name: Specifies a route policy to redistribute qualified routes only. A Route policy name is a string of up to 19 characters.
Description
Use the import-route command to redistribute routes from another protocol.
Use the undo import-route command to disable route redistribution from a protocol.
Route redistribution from another protocol is not configured by default.
OSPF prioritize routes as follows:
l Intra-area route
l Inter-area route
l Type1 External route
l Type2 External route
An intra-area route is a route in an OSPF area. An inter-area route is between any two OSPF areas. Both of them are internal routes.
An external route is a route to a destination outside the OSPF AS.
A Type-1 external route is an IGP route, such as RIP or STATIC, which has high reliability and whose cost is comparable with the cost of OSPF internal routes. Therefore, the cost from an OSPF router to a Type-1 external route’s destination equals the cost from the router to the corresponding ASBR plus the cost from the ASBR to the external route’s destination.
A Type-2 external route is an EGP route, which has low credibility, so OSPF considers the cost from the ASBR to a Type-2 external route is much bigger than the cost from the ASBR to an OSPF internal router. Therefore, the cost from an internal router to a Type-2 external route’s destination equals the cost from the ASBR to the Type-2 external route’s destination.
Related commands: default-route-advertise.
l The import-route command cannot redistribute default routes.
l Use the import-route bgp allow-ibgp command with care, because it redistributes both EBGP and IBGP routes that may cause routing loops.
Examples
# Redistribute routes from RIP process 40 and specify the type, tag, and cost as 2, 33 and 50 for redistributed routes.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] import-route rip 40 type 2 tag 33 cost 50
log-peer-change
Syntax
log-peer-change
undo log-peer-change
View
OSPF view
Default Level
2: System level
Parameters
None
Description
Use the log-peer-change command to enable the logging of OSPF neighbor state changes.
Use the undo log-peer-change command to disable the logging.
The logging is enabled by default.
With this feature enabled, information about neighbor state changes is displayed on the terminal until the feature is disabled.
Examples
# Disable the logging of neighbor state changes for OSPF process 100.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] undo log-peer-change
lsa-arrival-interval
Syntax
lsa-arrival-interval interval
undo lsa-arrival-interval
View
OSPF view
Default Level
2: System level
Parameters
interval: Specifies the minimum LSA repeat arrival interval in milliseconds, in the range 0 to 60000.
Description
Use the lsa-arrival-interval command to specify the minimum LSA repeat arrival interval.
Use the undo lsa-arrival-interval command to restore the default.
The interval defaults to 1000 milliseconds.
If an LSA that has the same LSA type, LS ID, originating router ID with the previous LSA is received within the interval, the LSA will be discarded. This feature helps protect routers and bandwidth from being over-consumed due to frequent network changes.
It is recommended the interval set with the lsa-arrival-interval command is smaller or equal to the initial interval set with the lsa-generation-interval command.
Related commands: lsa-generation-interval.
Examples
# Set the LSA minimum repeat arrival interval to 200 milliseconds.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] lsa-arrival-interval 200
lsa-generation-interval
Syntax
lsa-generation-interval maximum-interval [ initial-interval [ incremental-interval ] ]
undo lsa-generation-interval
View
OSPF view
Default Level
2: System level
Parameters
maximum-interval: Maximum LSA generation interval in seconds, in the range 1 to 60.
initial-interval: Minimum LSA generation interval in milliseconds, in the range 10 to 60000. The default is 0.
incremental-interval: LSA generation incremental interval in milliseconds, in the range 10 to 60000. The default is 5000 milliseconds.
Description
Use the lsa-generation-interval command to configure the OSPF LSA generation interval.
Use the undo lsa-generation-interval command to restore the default.
The LSA generation interval defaults to 5 seconds.
With this command configured, when network changes are not frequent, LSAs are generated at the initial-interval. If network changes become frequent, LSA generation interval is incremented by a specified value each time a generation happens, up to the maximum-interval.
Related commands: lsa-arrival-interval.
Examples
# Configure the maximum LSA generation interval as 2 seconds, minimum interval as 100 milliseconds and incremental interval as 100 milliseconds.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] lsa-generation-interval 2 100 100
lsdb-overflow-limit
Syntax
lsdb-overflow-limit number
undo lsdb-overflow-limit
View
OSPF view
Default Level
2: System level
Parameters
number: Specifies the upper limit of external LSAs in the LSDB, in the range 1 to 1000000.
Description
Use the lsdb-overflow-limit command to specify the upper limit of external LSAs in the LSDB.
Use the undo lsdb-overflow-limit command to restore the default.
External LSAs in the LSDB are unlimited by default.
Examples
# Specify the upper limit of external LSAs as 400000.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] lsdb-overflow-limit 400000
maximum load-balancing (OSPF view)
Syntax
maximum load-balancing maximum
undo maximum load-balancing
View
OSPF view
Default Level
2: System level
Parameters
maximum: Maximum number of equal cost routes for load balancing, in the range 1 to 4. No load balancing is available when the number is set to 1.
Description
Use the maximum load-balancing command to specify the maximum number of equal cost routes for load balancing.
Use the undo maximum load-balancing command to restore the default.
By default, the maximum number of equal cost routes is 4.
Examples
# Specify the maximum number of equal cost routes for load balancing as 2.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] maximum load-balancing 2
maximum-routes
Syntax
maximum-routes { external | inter | intra } number
undo maximum-routes { external | inter | intra }
View
OSPF view
Default Level
2: System level
Parameters
external: Specifies the maximum number of external routes.
inter: Specifies the maximum number of inter-area routes.
intra: Specifies the maximum number of intra-area routes.
number: Maximum route number, in the range 0 to 128000.
Description
Use the maximum-routes command to specify the maximum route number of a specified type, inter-area, intra-area or external.
Use the undo maximum-routes command to restore the default route maximum value of a specified type.
By default, the maximum route number is 128000.
Examples
# Specify the maximum number of intra-area routes as 500.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] maximum-routes intra 500
network (OSPF area view)
Syntax
network ip-address wildcard-mask
undo network ip-address wildcard-mask
View
OSPF area view
Default Level
2: System level
Parameters
ip-address: IP address of a network.
wildcard-mask: Wildcard mask of the IP address. For example, the wildcard mask of mask 255.0.0.0 is 0.255.255.255.
Description
Use the network command to enable OSPF on the interface attached to the specified network in the area.
Use the undo network command to disable OSPF for the interface attached to the specified network in the area.
By default, an interface neither belongs to any area nor runs OSPF.
You can configure one or multiple interfaces in an area to run OSPF. Note that the interface’s primary IP address must fall into the specified network segment to make the interface run OSPF. If only the interface’s secondary IP address falls into the network segment, the interface cannot run OSPF.
Related commands: ospf.
Examples
# Specify the interface whose primary IP address falls into 131.108.20.0/24 to run OSPF in Area 2.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 2
[Sysname-ospf-100-area-0.0.0.2] network 131.108.20.0 0.0.0.255
nssa
Syntax
nssa [ default-route-advertise | no-import-route | no-summary ] *
undo nssa
View
OSPF area view
Default Level
2: System level
Parameters
default-route-advertise: Usable on an NSSA ABR or an ASBR only. If it is configured on an NSSA ABR, the ABR generates a default route in a Type-7 LSA into the NSSA regardless of whether the default route is available. If it is configured on an ASBR, only a default route is available on the ASBR can it generates the default route in a Type-7 LSA into the attached area.
no-import-route: Usable only on an NSSA ABR that is also the ASBR of the OSPF routing domain to disable redistributing routes in Type7 LSAs into the NSSA area, making sure that routes can be redistributed correctly.
no-summary: Usable only on an NSSA ABR to advertise only a default route in a Type-3 summary LSA into the NSSA area. In this way, all the other summary LSAs are not advertised into the area. Such an area is known as an NSSA totally stub area.
Description
Use the nssa command to configure the current area as an NSSA area.
Use the undo nssa command to restore the default.
By default, no NSSA area is configured.
All routers attached to an NSSA area must be configured with the nssa command in area view.
Related commands: default-cost.
Examples
# Configure Area 1 as an NSSA area.
[Sysname] ospf 100
[Sysname-ospf-100] area 1
[Sysname-ospf-100-area-0.0.0.1] nssa
opaque-capability enable
Syntax
opaque-capability enable
undo opaque-capability
View
OSPF view
Default Level
2: System level
Parameters
None
Description
Use the opaque-capability enable command to enable opaque LSA advertisement and reception. With the command configured, the OSPF device can receive and advertise the Type-9, Type-10 and Type-11 opaque LSAs.
Use the undo opaque-capability command to restore the default.
The feature is disabled by default.
Examples
# Enable advertising and receiving opaque LSAs.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100]opaque-capability enable
ospf
Syntax
ospf [ process-id | router-id router-id | vpn-instance instance-name ] *
undo ospf [ process-id ]
View
System view
Default Level
2: System level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
router-id: OSPF Router ID, in dotted decimal format.
instance-name: VPN instance name, a string of 1 to 31 characters.
Description
Use the ospf command to enable an OSPF process.
Use the undo ospf command to disable an OSPF process.
No OSPF process is enabled by default.
You can enable multiple OSPF processes on a router and specify different Router IDs for these processes.
When using OSPF as the IGP for MPLS VPN implementation, you need to bind the OSPF process with a VPN instance.
Enabling OSPF first is required before performing other tasks.
Examples
# Enable OSPF process 100 and specify Router ID 10.10.10.1.
<Sysname> system-view
[Sysname] ospf 100 router-id 10.10.10.1
[Sysname-ospf-100]
ospf authentication-mode
Syntax
For MD5/HMAC-MD5 authentication:
ospf authentication-mode { md5 | hmac-md5 } key-id [ plain | cipher ] password
undo ospf authentication-mode { md5 | hmac-md5 } key-id
For simple authentication:
ospf authentication-mode simple [ plain | cipher ] password
undo ospf authentication-mode simple
View
Interface view
Default Level
2: System level
Parameters
md5: MD5 authentication.
hmac-md5: HMAC-MD5 authentication.
simple: Simple authentication.
key-id: Authentication key ID, in the range 1 to 255.
plain | cipher: Plain or cipher password. If plain is specified, only plain password is supported and displayed upon displaying the configuration file. If cipher is specified, both plain and cipher are supported, but only cipher password is displayed when displaying the configuration file. If no keyword is specified, the cipher type is the default for the MD5/HMAC-MD5 authentication mode, and the plain type is the default for the simple authentication mode.
password: Password. Simple authentication: For plain type password, a plain password is a string of up to 8 characters; for cipher type password, a plain password is a string of up to 8 characters, and a cipher password is a string of up to 24 characters. MD5/HMAC-MD5 authentication: For plain type password, a plain password is a string of up to16 characters; for cipher type password, a plain password is a string of up to 16 characters, and a cipher password is a string of up to 24 characters.
Description
Use the ospf authentication-mode command to set the authentication mode and key ID on an interface.
Use the undo ospf authentication-mode command to remove specified configuration.
By default, no authentication is available on an interface.
Interfaces attached to the same network segment must have the same authentication password and mode.
This configuration is not supported on the null interface.
Related commands: authentication-mode.
Examples
# Configure the network 131.119.0.0/16 in Area 1 to support MD5 cipher authentication, and set the interface key ID to 15, authentication password to abc, and password type to cipher.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 1
[Sysname-ospf-100-area-0.0.0.1] network 131.119.0.0 0.0.255.255
[Sysname-ospf-100-area-0.0.0.1] authentication-mode md5
[Sysname-ospf-100-area-0.0.0.1] quit
[Sysname-ospf-100] quit
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf authentication-mode md5 15 cipher abc
# Configure the network 131.119.0.0/16 in Area 1 to support simple authentication, and set for the interface the authentication password to abc, and password type to cipher.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 1
[Sysname-ospf-100-area-0.0.0.1] network 131.119.0.0 0.0.255.255
[Sysname-ospf-100-area-0.0.0.1] authentication-mode simple
[Sysname-ospf-100-area-0.0.0.1] quit
[Sysname-ospf-100] quit
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf authentication-mode simple cipher abc
ospf cost
Syntax
ospf cost value
undo ospf cost
View
Interface view
Default Level
2: System level
Parameters
value: OSPF cost, in the range 1 to 65535.
Description
Use the ospf cost command to set an OSPF cost for the interface.
Use the undo ospf cost command to restore the default.
By default, an OSPF interface calculates its cost with the formula: interface default OSPF cost=100 Mbps/interface bandwidth(Mbps). Default OSPF costs of some interfaces are:
l 1785 for the 56 kbps serial interface
l 1562 for the 64 kbps serial interface
l 48 for the E1 (2.048 Mbps) interface
l 1 for the Ethernet interface
You can use the ospf cost command to set an OSPF cost for an interface manually.
This configuration is not supported on the null or loopback interfaces .
Examples
# Set the OSPF cost for the interface to 65.
<Sysname> system-view
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf cost 65
ospf dr-priority
Syntax
ospf dr-priority priority
undo ospf dr-priority
View
Interface view
Default Level
2: System level
Parameters
priority: DR Priority of the interface, in the range 0 to 255.
Description
Use the ospf dr-priority command to set the priority for DR/BDR election on an interface.
Use the undo ospf dr-priority command to restore the default value.
By default, the priority is 1.
The bigger the value, the higher the priority.
The DR priority configuration is not supported on the null and loopback interfaces.
Examples
# Set the DR priority on the current interface to 8.
<Sysname> system-view
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf dr-priority 8
ospf mib-binding
Syntax
ospf mib-binding process-id
undo ospf mib-binding
View
System view
Default Level
2: System level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
Description
Use the ospf mib-binding command to bind an OSPF process to MIB operation.
Use the undo ospf mib-binding command to restore the default.
By default, MIB operation is bound to the first enabled OSPF process.
Examples
# Bind OSPF process 100 to MIB operation.
<Sysname> system-view
[Sysname] ospf mib-binding 100
# Restore the default, that is, bind the first enabled OSPF process to MIB operation.
<Sysname> system-view
[Sysname] undo ospf mib-binding
ospf mtu-enable
Syntax
ospf mtu-enable
undo ospf mtu-enable
View
Interface view
Default Level
2: System level
Parameters
None
Description
Use the ospf mtu-enable command to enable an interface to add the real MTU into DD packets.
Use the undo ospf mtu-enable command to restore the default.
By default, an interface adds a MTU of 0 into DD packets, that is, no real MTU is added.
Note that:
l After a virtual link is established via a Tunnel, two devices on the link from different vendors may have different MTU values. To make them consistent, set the attached interfaces’ default MTU to 0.
l This configuration is not supported on the null interface.
Examples
# Enable the interface to add the real MTU value into DD packets.
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf mtu-enable
ospf network-type
Syntax
ospf network-type { broadcast | nbma | p2mp | p2p }
undo ospf network-type
View
Interface view
Default Level
2: System level
Parameters
broadcast: Specifies the network type as Broadcast.
nbma: Specifies the network type as NBMA.
p2mp: Specifies the network type as P2MP.
p2p: Specifies the network type as P2P.
Description
Use the ospf network-type command to set the network type for an interface.
Use the undo ospf network-type command to restore the default network type for an interface.
By default, the network type of an interface depends on its link layer protocol.
l For Ethernet, and FDDI, the default network type is broadcast.
l For ATM, FR, and X.25, the default network type is NBMA.
l For PPP, LAPB, HDLC, and POS, the default network type is P2P.
Note that:
l If a router on a broadcast network does not support multicast, you can configure the interface’s network type as NBMA.
l If any two routers on an NBMA network are directly connected via a virtual link, that is, the network is fully meshed, you can configure the network type as NBMA; otherwise you need to configure it as P2MP for two routers having no direct link to exchange routing information via another router.
l When the network type of an interface is NBMA, you need to use the peer command to specify a neighbor.
l If only two routers run OSPF on a network segment, you can configure associated interfaces’ network type as P2P.
Related commands: ospf dr-priority.
This command is not supported on the null or loopback interfaces.
Examples
# Configure the interface’s network type as NBMA.
<Sysname> system-view
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf network-type nbma
ospf packet-process prioritized-treatment
Syntax
ospf packet-process prioritized-treatment
undo ospf packet-process prioritized-treatment
View
System view
Parameters
None
Description
Use the ospf packet-process prioritized-treatment command to enable OSPF to give priority to receiving and processing Hello packets.
Use the undo ospf packet-process prioritized-treatment command to restore the default.
By default, this function is not enabled.
Examples
# Enable OSPF to give priority to receiving and processing Hello packets.
<Sysname> system-view
[Sysname] ospf packet-process prioritized-treatment
ospf timer dead
Syntax
ospf timer dead seconds
undo ospf timer dead
View
Interface view
Default Level
2: System level
Parameters
seconds: Dead interval in seconds, in the range 1 to 2147483647.
Description
Use the ospf timer dead command to set the dead interval.
Use the undo ospf timer dead command to restore the default.
The dead interval defaults to 40s for Broadcast, P2P interfaces and defaults to 120s for P2MP and NBMA interfaces.
If an interface receives no hello packet from the neighbor within the dead interval, the interface considers the neighbor down. The dead interval on an interface is at least four times the hello interval. Any two routers attached to the same segment must have the same dead interval.
This configuration is not supported on the null interface.
Related commands: ospf timer hello.
Examples
# Configure the dead interval on the current interface as 60 seconds.
<Sysname> system-view
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf timer dead 60
ospf timer hello
Syntax
ospf timer hello seconds
undo ospf timer hello
View
Interface view
Default Level
2: System level
Parameters
seconds: Hello interval in seconds, in the range 1 to 65535.
Description
Use the ospf timer hello command to set the hello interval on an interface.
Use the undo ospf timer hello command to restore the default hello interval on an interface.
The hello interval defaults to 10s for P2P and Broadcast interfaces, and defaults to 30s for P2MP and NBMA interfaces.
The shorter the hello interval is, the faster the topology converges and the more resources are consumed. Make sure the hello interval on two neighboring interfaces is the same.
This configuration is not supported on the null interface.
Related commands: ospf timer dead.
Examples
# Configure the hello interval on the current interface as 20 seconds.
<Sysname> system-view
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf timer hello 20
ospf timer poll
Syntax
ospf timer poll seconds
undo ospf timer poll
View
Interface view
Default Level
2: System level
Parameters
seconds: Poll interval in seconds, in the range 1 to 2147483647.
Description
Use the ospf timer poll command to set the poll interval on an NBMA interface.
Use the undo ospf timer poll command to restore the default value.
By default, the poll interval is 120s.
When an NBMA interface finds its neighbor is down, it will send hello packets at the poll interval.
The poll interval is at least four times the hello interval.
This configuration is not supported on the null interface.
Related commands: ospf timer hello.
Examples
# Set the poll timer interval on the current interface to 130 seconds.
<Sysname> system-view
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf timer poll 130
ospf timer retransmit
Syntax
ospf timer retransmit interval
undo ospf timer retransmit
View
Interface view
Default Level
2: System level
Parameters
interval: LSA retransmission interval in seconds, in the range 1 to 3600.
Description
Use the ospf timer retransmit command to set the LSA retransmission interval on an interface.
Use the undo ospf timer retransmit command to restore the default.
The interval defaults to 5s.
After sending an LSA, an interface waits for an acknowledgement packet. If the interface receives no acknowledgement within the retransmission interval, it will retransmit the LSA.
The retransmission interval should not be so small to avoid unnecessary retransmissions.
This configuration is not supported on the null interface.
Examples
# Set the LSA retransmission interval to 8 seconds.
<Sysname> system-view
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf timer retransmit 8
ospf trans-delay
Syntax
ospf trans-delay seconds
undo ospf trans-delay
View
Interface view
Default Level
2: System level
Parameters
seconds: LSA transmission delay in seconds, in the range 1 to 3600.
Description
Use the ospf trans-delay command to set the LSA transmission delay on an interface.
Use the undo ospf trans-delay command to restore the default.
The delay defaults to 1s.
Each LSA in the LSDB has an age that is incremented by 1 every second, but the age does not change during transmission. It is necessary to add a transmission delay into its age time, which is important for low speed networks.
This configuration is not supported on the null interface.
Examples
# Set the LSA transmission delay to 3 seconds on the current interface.
<Sysname> system-view
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf trans-delay 3
peer
Syntax
peer ip-address [ dr-priority dr-priority ]
undo peer ip-address
View
OSPF view
Default Level
2: System level
Parameters
ip-address: Neighbor IP address.
dr-priority: Neighbor DR priority, in the range 0 to 255.
Description
Use the peer command to specify a neighbor, and the DR priority of the neighbor.
Use the undo peer command to remove the configuration.
On an Frame Relay network, you can configure mappings to make the network fully meshed (any two routers have a direct link in between), so OSPF can handle DR/BDR election as it does on a broadcast network. However, since routers on the network cannot find neighbors via broadcasting hello packets, you need to specify neighbors and neighbor DR priorities on the routers.
After startup, a router sends a hello packet to neighbors with DR priorities higher than 0. When the DR and BDR are elected, the DR will send hello packets to all neighbors for adjacency establishment.
A router uses the priority set with the peer command to determine whether to send a hello packet to the neighbor rather than for DR election. The DR priority set with the ospf dr-priority command is used for DR election.
Related commands: ospf dr-priority.
Examples
# Specify the neighbor 1.1.1.1.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] peer 1.1.1.1
preference
Syntax
preference [ ase ] [ route-policy route-policy-name ] value
undo preference [ ase ]
View
OSPF view
Default Level
2: System level
Parameters
ase: Sets a priority for ASE routes. If the keyword is not specified, using the command sets a priority for OSPF internal routes.
route-policy route-policy-name: Applies a route policy to set priorities for specified routes. route-policy-name is a string of 1 to 19 characters.
value: Priority value, in the range 1 to 255. A smaller value represents a higher priority.
Description
Use the preference command to set the priority of OSPF routes.
Use the undo preference command to restore the default.
The priority of OSPF internal routes defaults to 10, and the priority of OSPF external routes defaults to 150.
If a route policy is specified, priorities defined by the route policy will apply to matching routes, and the priorities set with the preference command apply to OSPF routes not matching the route policy.
A router may run multiple routing protocols. When several routing protocols find routes to the same destination, the router uses the route found by the protocol with the highest priority.
Examples
# Set a priority of 200 for OSPF external routes.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] preference ase 200
reset ospf counters
Syntax
reset ospf [ process-id ] counters [ neighbor [ interface-type interface-number ] [ router-id ] ]
View
User view
Default Level
2: System level
Parameters
process-id: Clears the statistics information of the specified OSPF process, which is in the range 1 to 65535.
neighbor: Clears neighbor statistics.
interface-type interface-number: Clears the statistics information of the neighbor connected to the specified interface.
router-id: Clears the statistics information of the specified neighbor.
Description
Use the reset ospf counters command to clear OSPF statistics information.
Examples
# Reset OSPF counters.
<Sysname> reset ospf counters
reset ospf process
Syntax
reset ospf [ process-id ] process [ graceful-restart ]
View
User view
Default Level
2: System level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
graceful-restart: Starts GR for the OSPF process.
Description
Use the reset ospf process command to reset all OSPF processes or a specified process.
Using the reset ospf process command will:
l Clear all invalid LSAs without waiting for their timeouts;
l Make a newly configured Router ID take effect;
l Start a new round of DR/BDR election;
l Not remove any previous OSPF configurations.
The system prompts whether to reset OSPF process upon execution of this command.
Examples
# Reset all OSPF processes.
<Sysname> reset ospf process
reset ospf redistribution
Syntax
reset ospf [ process-id ] redistribution
View
User view
Default Level
2: System level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
Description
Use the reset ospf redistribution command to restart route redistribution. If no process ID is specified, using the command restarts route redistribution for all OSPF processes.
Examples
# Restart route redistribution.
<Sysname> reset ospf redistribution
rfc1583 compatible
Syntax
rfc1583 compatible
undo rfc1583 compatible
View
OSPF view
Default Level
2: System level
Parameters
None
Description
Use the rfc1583 compatible command to make routing rules defined in RFC1583 compatible.
Use the undo rfc1583 compatible command to disable the function.
By default, RFC1583 routing rules are compatible.
RFC1583 and RFC2328 have different routing rules on selecting the best route when multiple AS external LSAs describe routes to the same destination. Using this command can make them compatible.
Examples
# Disable making RFC1583 routing rules compatible.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] undo rfc1583 compatible
silent-interface (OSPF view)
Syntax
silent-interface { all | interface-type interface-number }
undo silent-interface { all | interface-type interface-number }
View
OSPF view
Default Level
2: System level
Parameters
all: Disables all interfaces from sending OSPF packets.
interface-type interface-number: Disables the specified interface from sending OSPF packets
Description
Use the silent-interface command to disable an interface or all interfaces from sending OSPF packets.
Use the undo silent-interface command to restore the default.
By default, an interface sends OSPF packets.
A disabled interface is a passive interface, which cannot send any hello packet.
To make no routing information obtained by other routers on a network segment, you can use this command to disable the interface from sending OSPF packets.
Examples
# Disable an interface from sending OSPF packets.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] silent-interface vlan-interface 10
snmp-agent trap enable ospf
Syntax
snmp-agent trap enable ospf [ process-id ] [ ifauthfail | ifcfgerror | ifrxbadpkt | ifstatechange | iftxretransmit | lsdbapproachoverflow | lsdboverflow | maxagelsa | nbrstatechange | originatelsa | vifcfgerror | virifauthfail | virifrxbadpkt | virifstatechange | viriftxretransmit | virnbrstatechange ] *
undo snmp-agent trap enable ospf [ process-id ] [ ifauthfail | ifcfgerror | ifrxbadpkt | ifstatechange | iftxretransmit | lsdbapproachoverflow | lsdboverflow | maxagelsa | nbrstatechange | originatelsa | vifcfgerror | virifauthfail | virifrxbadpkt | virifstatechange | viriftxretransmit | virnbrstatechange ] *
View
System view
Default Level
3: Manage level
Parameters
process-id: OSPF process ID, in the range 1 to 65535.
ifauthfail: Interface authentication failure information.
ifcfgerror: Interface configuration error information.
ifrxbadpkt: Information about error packets received.
ifstatechange: Interface state change information.
iftxretransmit: Packet receiving and forwarding information.
lsdbapproachoverflow: Information about cases approaching LSDB overflow.
lsdboverflow: LSDB overflow information.
maxagelsa: LSA max age information.
nbrstatechange: Neighbor state change information.
originatelsa: Information about LSAs originated locally.
vifauthfail: Virtual interface authentication failure information.
vifcfgerror: Virtual interface configuration error information.
virifauthfail: Virtual interface authentication failure information.
virifrxbadpkt: Information about error packets received by virtual interfaces.
virifstatechange: Virtual interface state change information.
viriftxretransmit: Virtual interface packet retransmission information.
virnbrstatechange: Virtual interface neighbor state change information.
Description
Use the snmp-agent trap enable ospf command to enable the sending of SNMP traps for a specified OSPF process. If no process is specified, the feature is enabled for all processes.
Use the undo snmp-agent trap enable ospf command to disable the feature.
By default, this feature is enabled.
Refer to SNMP Commands in the System Volume for related information.
Examples
# Enable the sending of SNMP traps for OSPF process 1.
<Sysname> system-view
[Sysname] snmp-agent trap enable ospf 1
spf-schedule-interval
Syntax
spf-schedule-interval maximum-interval [ minimum-interval [ incremental-interval ] ]
undo spf-schedule-interval
View
OSPF view
Default Level
2: System level
Parameters
maximum-interval: Maximum OSPF route calculation interval in seconds, in the range 1 to 60.
minimum-interval: Minimum OSPF route calculation interval in milliseconds, in the range 10 to 60000, which defaults to 0.
incremental-interval: Incremental value in milliseconds, in the range 10 to 60000, which defaults to 5000.
Description
Use the spf-schedule-interval command to set the OSPF SPF calculation interval.
Use the undo spf-schedule-interval command to restore the default.
The interval defaults to 5 seconds.
Based on its LSDB, an OSPF router calculates the shortest path tree with itself being the root, and uses it to determine the next hop to a destination. Through adjusting the SPF calculation interval, you can protect bandwidth and router resources from being over-consumed due to frequent network changes.
With this command configured, when network changes are not frequent, SPF calculation applies at the minimum-interval. If network changes become frequent, the SPF calculation interval is incremented by the incremental-interval each time a calculation happens, up to the maximum-interval.
Examples
# Configure the SPF calculation maximum interval as 10 seconds, minimum interval as 500 milliseconds and incremental interval as 200 milliseconds.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] spf-schedule-interval 10 500 200
stub (OSPF area view)
Syntax
stub [ no-summary ]
undo stub
View
OSPF area view
Default Level
2: System level
Parameters
no-summary: Usable only on a stub ABR. With it configured, the ABR advertises only a default route in a Summary LSA into the stub area (such a stub area is known as a totally stub area).
Description
Use the stub command to configure an area as a stub area.
Use the undo stub command to remove the configuration.
No area is stub area by default.
Note that, to concel the no-summary configuration on the ABR, simply execute the stub command again to overwrite it.
To configure an area as a stub area, all routers attached to it must be configured with this command.
Related commands: default-cost.
Examples
# Configure Area1 as a stub area.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 1
[Sysname-ospf-100-area-0.0.0.1] stub
stub-router
Syntax
stub-router
undo stub-router
View
OSPF view
Default Level
2: System level
Parameters
None
Description
Use the stub-router command to configure the router as a stub router.
Use the undo stub-router command to restore the default.
By default, no router is configured as a stub router.
The router LSAs from the stub router may contain different link type values. A value of 3 means a link to the stub network, so the cost of the link remains unchanged. A value of 1, 2 or 4 means a point-to-point link, a link to a transit network or a virtual link; in such cases, a maximum cost value of 65535 is used. Thus, other neighbors find the links to the stub router have such big costs, they will not send packets to the stub router for forwarding as long as there is a route with a smaller cost.
Examples
# Configure a stub router.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] stub-router
transmit-pacing
Syntax
transmit-pacing interval interval count count
undo transmit-pacing
View
OSPF view
Default Level
2: System level
Parameters
interval: Interval at which an interface sends LSU packets, in milliseconds. Its value is in the range 10 to 1000. If the router has a number of OSPF interfaces, you are recommended to increase this interval to reduce the total numbers of LSU packets sent by the router every second.
count: Maximum number of LSU packets sent by an interface at each interval. It is in the range 1 to 200. If the router has a number of OSPF interfaces, you are recommended to decrease this interval to reduce the total numbers of LSU packets sent by the router every second.
Description
Use the transmit-pacing command to configure the maximum number of LSU packets that can be sent every the specified interval.
Use the undo transmit-pacing command to restore the default.
By default, an OSPF interface sends up to three LSU packets every 20 milliseconds.
Examples
# Configure all the interfaces under OSPF process 1 to send up to 10 LSU packets every 30 milliseconds.
<Sysname> system-view
[Sysname-ospf-1] transmit-pacing interval 30 count 10
vlink-peer (OSPF area view)
Syntax
vlink-peer router-id [ hello seconds | retransmit seconds | trans-delay seconds | dead seconds | simple [ plain | cipher ] password | { md5 | hmac-md5 } key-id [ plain | cipher ] password ] *
undo vlink-peer router-id [ hello | retransmit | trans-delay | dead | [ simple | { md5 | hmac-md5 } key-id ] ] *
View
OSPF area view
Default Level
2: System level
Parameters
router-id: Router ID of the neighbor on the virtual link.
hello seconds: Hello interval in seconds, in the range 1 to 8192. The default is 10. It must be identical to the hello interval on its virtual link neighbor.
retransmit seconds: Retransmission interval in seconds, in the range 1 to 3600, which defaults to 5.
trans-delay seconds: Transmission delay interval in seconds, in the range 1 to 3600, which defaults to 1.
dead seconds: Dead interval in seconds, in the range 1 to 32768, which defaults to 40 and is identical to the value on its virtual link neighbor. The dead interval is at least four times the hello interval.
md5: MD5 authentication.
hmac-md5: HMAC-MD5 authentication.
simple: Simple authentication.
key-id: Key ID for MD5 or HMAC-MD5 authentication, in the range 1 to 255.
plain | cipher: Plain or cipher type. If plain is specified, only plain password is supported and displayed upon displaying the configuration file. If cipher is specified, both plain and cipher are supported, but only cipher password is displayed when displaying the configuration file. By default, MD5 and HMAC-MD5 support cipher password, and simple authentication supports plain password.
password: Plain or cipher password. Simple authentication: For plain type, a plain password is a string of up to 8 characters. For cipher type, a plain password is a string of up to 8 characters, and a cipher password is a string of up to 24 characters. MD5/HMAC-MD5 authentication: For plain type, a plain password is a string of up to16 characters. For cipher type, a plain password is a string of up to 16 characters, and a cipher password is a string of up to 24 characters.
Description
Use the vlink-peer command to configure a virtual link.
Use the undo vlink-peer command to remove a virtual link.
As defined in RFC2328, all non-backbone areas must maintain connectivity to the backbone. You can use the vlink-peer command to configure a virtual link to connect an area to the backbone.
Considerations on parameters:
l The smaller the hello interval is, the faster the network converges and the more network resources are consumed.
l A so small retransmission interval will lead to unnecessary retransmissions. A big value is appropriate for a low speed link.
l You need to specify an appropriate transmission delay with the trans-delay keyword.
The authentication mode at the non-backbone virtual link end follows the one at the backbone virtual link end. The two authentication modes (MD5 or Simple) are independent, and you can specify neither of them.
Related commands: authentication-mode, display ospf.
Examples
# Configure a virtual link to the neighbor with router ID 1.1.1.1.
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 2
[Sysname-ospf-100-area-0.0.0.2] vlink-peer 1.1.1.1