The hostname command enables the OSPF dynamic hostname function.
The undo hostname command disables the OSPF dynamic hostname function.
By default, the OSPF dynamic hostname function is disabled.
| Parameter | Description | Value |
|---|---|---|
| hostname | Specifies the OSPF hostname. | The value is a string of 1 to 255 characters. |
Application Scenario
To facilitate network management, configure dynamic hostnames to identify routers. After you run the hostname command to configure a dynamic hostname for a router, the router generates a router information (RI) Opaque LSA, from which you can check the mapping between the router ID and the dynamic hostname.
RI Opaque LSAs are generated based on the following rules:
After a router receives a RI Opaque LSA, you can run the display ospf hostname-table command on the router to check the mapping between the router ID and the dynamic hostname.
Prerequisites
The Opaque LSA capability has been enabled using the opaque-capability enable command.
Precautions
If you specify hostname in this command, hostname is advertised as the dynamic hostname. If no hostname is specified in this command, the device name specified in the sysname command is advertised as the dynamic hostname.