The ospf command creates and runs an OSPF process.
The undo ospf command terminates an OSPF process.
By default, OSPF is disabled, that is, no OSPF process runs.
ospf [ process-id | router-id router-id | vpn-instance vpn-instance-name ] *
undo ospf process-id [ flush-waiting-timer time ]
Parameter | Description | Value |
---|---|---|
process-id |
Specifies the ID of an OSPF process. |
The value is an integer ranging from 1 to 65535. By default, it is 1. |
router-id router-id |
Specifies a router ID. |
The value is in dotted decimal notation. |
vpn-instance vpn-instance-name |
Specifies the name of a VPN instance. |
The value must be an existing VPN instance name. |
flush-waiting-timer time |
Indicates the interval for generating aged LSAs. The parameter takes effect only when it is set. |
The value is an integer that ranges from 1 to 40, in seconds. |
Usage Scenario
You can set OSPF parameters only after creating an OSPF process.
OSPF supports multi-process. More than one OSPF process can run on the same device and are independent of each other. Route interaction between different OSPF processes is similar to route interaction between different routing protocols.
An OSPF router ID can be manually configured or automatically selected. To ensure OSPF stability, you are advised to manually configure the IP address of a loopback interface as the router ID.
If no OSPF router ID is manually configured for a router, the router selects the global router ID as its OSPF router ID. If both the OSPF router ID and global router ID are not configured, the router selects a router ID based on IP addresses of current interfaces:
If there are loopback interfaces that have IP addresses configured, the device selects the largest IP address among loopback interface addresses as the global router ID.
If no loopback interface is configured or loopback interfaces do not have IP addresses configured, the device selects the largest IP address among interface addresses as the global router ID without considering the Up/Down state of interfaces.
Configuration Impact
After an OSPF process is disabled using undo ospf command, the receive end still maintains the LSAs generated by this OSPF process. These invalid LSAs occupy the system memory and are deleted only when the LS age field (aging time) reaches 3600 seconds. When the undo ospf process-id flush-waiting-timer time command is used to delete an OSPF process, the switch regenerates an LSA in the set time and sets the LS age field to 3600 seconds. After other switches receive the LSA with the LS age field as 3600 seconds, they delete the LSA immediately. If the host does not send all the LSAs in the set time, other switches still reserve invalid LSAs.
When the LS age field (aging time) in the LSA header reaches 3600 seconds, this LSA is deleted.
Precautions
An interface on a device belongs to only one OSPF process.
If a VPN instance is specified, the OSPF process specified in this command belongs to this VPN instance. If no VPN instance is specified, the OSPF process specified in this command belongs to the global VPN instance. vpn-instance-name cannot be changed after being specified.
The router ID of each OSPF process must be unique on the entire network; otherwise, the OSPF neighbor relationship cannot be set up and routing information is incorrect. Configuring a unique router ID for each OSPF process on each OSPF device is recommended.