hostname

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 [ host-name ]

undo hostname

Parameters

Parameter Description Value
host-name

Specifies the OSPF hostname.

The value is a string of 1 to 255 characters.

Views

OSPF view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
ospf write

Usage Guidelines

Usage Scenario

To facilitate network management, configure dynamic hostnames to identify routers. After you run the hostname command to configure a dynamic hostname for a device, the device generates a router information (RI) Opaque LSA.

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 not connected to NSSA or Stub areas generate and flood AS RI LSAs (Type 11 RI LSAs).
    • ASBRs that are connected to NSSA or Stub areas only do not generate RI Opaque LSAs within the AS.
  • ABRs and internal area routers flood RI Opaque LSAs to its connected areas.

    After a device 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 in this command, is advertised as the dynamic hostname. If no is specified in this command, the hostname specified in the sysname command is advertised as the dynamic hostname.

Example

# Configure OSPF hostname BLR and enable the OSPF dynamic hostname function.
<HUAWEI> system-view
[~HUAWEI] ospf 100
[*HUAWEI-ospf-100] opaque-capability enable
[*HUAWEI-ospf-100] hostname BLR
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >