Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding IP OSPF Name-Lookup Command

     

    Introduction

     

    By default, an OSPF neighbor is displayed by its router ID or Neighbor ID in an OSPF show EXEC commands. However the behavior can be re-structured or customized by displaying the hostname.

     

    To configure OSPF to look up Domain Name System (DNS) names for use in all OSPF show EXEC command displays, ip ospf name-lookup command in the global configuration mode.

     

    This command makes it easier to identify a router because the router is displayed by name rather than by its router ID or neighbor ID.

     

    Background

     

    In this topology, the three routers are configured with OSPF on a frame-relay network. The DLCI assignment and ip addressing scheme is given below.

    To achieve the name look-up task, all three routers are configured with the command “ip ospf name-lookup”.

     

    DLCI Assignment

    Router - To - RouterDLCI Number

    HUB --> Spoke-1203
    HUB --> Spoke-2204
    Spoke-1 --> HUB302
    Spoke-2 --> HUB402

     

    IP Addressing Scheme

     

    Router / InterfaceIP Address

    HUB Se 0/010.10.10.2 /24
    Spoke-1 Se 0/0

    10.10.10.3 /24

    Spoke-2 Se 0/0

    10.10.10.4 /24

     

    Note: All configurations are tested on Cisco 3745 Router running IOS 12.4 software.

     

    Topology Diagram

    Topo.bmp

    Configuration

    Summary Steps

    Step 1. Router (config) # ip host Name-Of-Host A.B.C.D

    Step 2. Router (config) # ip ospf name-lookup

     

    Router Configuration

    HUBSpoke-1Spoke-2

    hostname HUB

    ip cef

    ip host Spoke-1 3.3.3.3

    ip host Spoke-2 4.4.4.4

    ip host HUB 2.2.2.2

     

    interface Loopback0

    ip address 2.2.2.2 255.255.255.255

     

    interface Serial0/0

    ip address 10.10.10.2 255.255.255.0

    encapsulation frame-relay IETF

    ip ospf network broadcast

    frame-relay map ip 10.10.10.2 204

    frame-relay map ip 10.10.10.3 203 broadcast

    frame-relay map ip 10.10.10.4 204 broadcast

    no frame-relay inverse-arp

    frame-relay lmi-type cisco

     

    router ospf 10

    router-id 2.2.2.2

    log-adjacency-changes

    network 10.10.10.2 0.0.0.0 area 0

     

    ip ospf name-lookup

      end

    hostname Spoke-1

    ip cef

    ip host Spoke-1 3.3.3.3

    ip host Spoke-2 4.4.4.4

    ip host HUB 2.2.2.2

     

    interface Loopback0

    ip address 3.3.3.3 255.255.255.255

     

    interface Serial0/0

    ip address 10.10.10.3 255.255.255.0

    encapsulation frame-relay IETF

    ip ospf network broadcast

    frame-relay map ip 10.10.10.2 302 broadcast

    frame-relay map ip 10.10.10.3 302

    no frame-relay inverse-arp

    frame-relay lmi-type cisco

     

    router ospf 10

    router-id 3.3.3.3

    log-adjacency-changes

    network 10.10.10.3 0.0.0.0 area 0

     

    ip ospf name-lookup

     

    end

    hostname Spoke-2

    ip cef

    ip host Spoke-1 3.3.3.3

    ip host Spoke-2 4.4.4.4

    ip host HUB 2.2.2.2

     

    interface Loopback0

    ip address 4.4.4.4 255.255.255.255

     

    interface Serial0/0

    ip address 10.10.10.4 255.255.255.0

    encapsulation frame-relay IETF

    ip ospf network broadcast

    frame-relay map ip 10.10.10.2 402 broadcast

    frame-relay map ip 10.10.10.4 204

    no frame-relay inverse-arp

    frame-relay lmi-type cisco

     

    router ospf 10

    router-id 4.4.4.4

    log-adjacency-changes

    network 10.10.10.4 0.0.0.0 area 0

     

    ip ospf name-lookup

     

    end

     

    Note: The command is configured on all the routers.

    Verification Commands

    show ip ospf neighbor

    Output1.bmp

     

    Note: Under the Neighbor-ID column, we see the host names and not the Router-Id. If we remove the feature by "no ip ospf name-lookup" the output will be like below.

     

    Output2.bmp

    References

    IP Routing OSPF Command Reference - IOS 12.4

    IP Routing OSPF Configuration Guide

    Version history
    Revision #:
    2 of 2
    Last update:
    ‎08-24-2017 12:48 AM
    Updated by:
     
    Labels (1)
    Contributors