Configuring an OSPF Hostname

Compared with router IDs, OSPF hostnames are easier to memorize. Therefore, using hostnames to identify routers can facilitate network management.

Usage Scenario

To facilitate network management, configure hostnames to identify routers.

Either dynamic or static OSPF hostnames can be configured. In dynamic mode, a hostname can be configured on and advertised by the local device. The mapping between the local device's router ID and hostname can then be queried on a remote router that successfully learns this dynamic hostname.

Pre-configuration Tasks

Before configuring a hostname, complete the following tasks:

  • Configure an IP address for each interface to ensure that neighboring routers can use the IP addresses to communicate with each other.
  • Configure basic OSPF functions.

Procedure

  • Configure a dynamic OSPF hostname.
    1. Run system-view

      The system view is displayed.

    2. Run ospf [ process-id ]

      The OSPF process view is displayed.

    3. Run opaque-capability enable

      The Opaque LSA capability is enabled.

    4. Run hostname host-name

      An OSPF dynamic hostname is configured.

      If you specify hostname in hostname command, hostname is advertised as the dynamic hostname. If no hostname is specified in hostname command, the hostname specified in the sysname command is advertised as the dynamic hostname.

    5. Run commit

      The configuration is committed.

Checking the Configurations

Run either of the following commands to check dynamic OSPF hostnames:

  • display ospf [ process-id ] hostname-table
  • display ospf [ process-id ] lsdb [ router | network | summary | asbr | ase | nssa | opaque-link | opaque-area ] [ link-state-id ] [ originate-router [ advertising-router-id ] | self-originate | hostname hostname ] [ age { min-value min-age-value | max-value max-age-value } * ]
  • display ospf [ process-id ] lsdb [ router | network | summary | asbr | ase | nssa | opaque-link | opaque-area ] [ link-state-id ] [ originate-router [ advertising-router-id ] | self-originate ] [ age { min-value min-age-value | max-value max-age-value } * ] [ resolve-hostname ]
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >