< Home

hostname (OSPF)

Function

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.

Format

hostname [ hostname ]

undo hostname

Parameters

Parameter Description Value
hostname Specifies the OSPF hostname. The value is a string of 1 to 255 characters.

Views

OSPF view

Default Level

2: Configuration level

Usage Guidelines

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:

  • The rules based on which RI Opaque LSAs are generated on ASBRs are as follows:
    • ASBRs that are connected to NSSA or Stub areas generate and flood Type 10 RI Opaque LSAs (Type 10 RI LSAs).
    • ASBRs that are connected to common area generate and flood AS RI LSAs (Type 11 RI LSAs).
    • ASBRs that are connected to NSSA or Stub areas only does not generate AS RI LSAs.
  • ABRs and internal area routers flood RI Opaque LSAs to its connected areas.

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.

Example

# Configure OSPF hostname BLR and enable the OSPF dynamic hostname function.

<sysname> system-view
[sysname] ospf 100
[sysname-ospf-100] opaque-capability enable
[sysname-ospf-100] hostname BLR
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >