Cisco Nexus 1000V System Management Configuration Guide, Release 4.2(1)SV2(1.1)
Configuring CDP
Downloads: This chapterpdf (PDF - 1.32MB) The complete bookPDF (PDF - 6.72MB) | The complete bookePub (ePub - 2.87MB) | The complete bookMobi (Mobi - 5.19MB) | Feedback

Configuring CDP

Configuring CDP

This chapter contains the following sections:

Information About CDP

The Cisco Discovery Protocol (CDP), which runs over the data link layer, is used to advertise information to all attached Cisco devices and to discover and view information about attached Cisco devices. CDP runs on all Cisco-manufactured equipment.

Each device that you configure for CDP sends periodic advertisements to a multicast address. Each device advertises at least one address at which it can receive SNMP messages. The advertisements also contain hold-time information, which indicates the length of time that a receiving device should hold CDP information before discarding it. You can configure the advertisement or refresh timer and the hold timer.

CDP Version 2 (CDPv2) allows you to track instances where the native VLAN ID or port duplex states do not match between connecting devices.

CDP advertises the following type-length-value fields (TLVs):

  • Device ID
  • Address
  • Port ID
  • Capabilities
  • Version
  • Platform
  • Native VLAN
  • Full/half duplex
  • MTU
  • Sysname
  • SysObjectID
  • Management address
  • Physical location

All CDP packets include a VLAN ID. The CDP packet is untagged, so it goes over the native/access VLAN, which is then also added to the packet.

High Availability

Stateless restarts are supported for CDP. After a reboot or a supervisor switchover, the running configuration is applied.

Guidelines and Limitations

  • CDP gathers protocol addresses of neighboring devices and discovers the platform of those devices. CDP runs over the data link layer only. With CDP, two systems that support different Layer 3 protocols can learn about each other.
  • CDP can discover up to 256 neighbors per port if the port is connected to a hub with 256 connections.
  • CDP must be enabled globally before you can configure CDP on an interface. CDP is enabled globally by default but can be disabled.
  • You can configure CDP on physical interfaces and port channels only.

Default Settings

Parameters

Default

CDP

Enabled globally and on all interfaces

CDP version

Version 2

CDP device ID

System name

CDP timer

60 seconds

CDP hold timer

180 seconds

Configuring CDP

This section includes the following topics:

  • CDP Global Configuration
  • Enabling CDP on an Interface
  • Disabling CDP on an Interface

CDP Global Configuration

This section includes the following topics:

  • Enabling or Disabling CDP Globally
  • Advertising a CDP Version
  • Configuring CDP Options

Enabling or Disabling CDP Globally

Be sure you understand that when you globally disable the CDP feature, all CDP configurations are removed.

Before You Begin

Before beginning this procedure, you must be logged in to the CLI in EXEC mode.

Procedure
     Command or ActionPurpose
    Step 1switch# config t  

    Places you in global configuration mode.

     
    Step 2switch(config)# [no] cdp enable 

    Enables or disables the CDP feature globally.

     
    switch# config t
    switch(config)# no cdp enable

    Advertising a CDP Version

    Before beginning this procedure, be sure you have know the following information:

    • The version of CDP currently supported on the device.
    • Only one version of CDP (version 1 or version 2) is advertised at a time for all uplinks and port channels on the switch.
    Before You Begin

    Before beginning this procedure, you must be logged in to the CLI in EXEC mode.

    Procedure
       Command or ActionPurpose
      Step 1switch# config t  

      Places you in global configuration mode.

       
      Step 2switch(config)# cdp advertise {v1 | v2} 
      Assigns the CDP version to advertise:
      • CDP Version 1
      • CDP Version 2
       
      Step 3switch(config)# show cdp global   (Optional)

      Displays the CDP version that is being advertised or sent to other devices.

       
      Step 4switch(config)# copy running-config startup-config  (Optional)

      Copies the running configuration to the startup configuration.

       
      switch# config t
      switch(config)# cdp advertise v1
      switch(config)# show cdp global 
      Global CDP information:
          CDP enabled globally
          Sending CDP packets every 60 seconds
          Sending a holdtime value of 180 seconds
          Sending CDPv2 advertisements is disabled
          Sending DeviceID TLV in Default Format
      switch(config)# copy running-config startup-config

      Configuring CDP Options

      You can configure the following for CDP:

      • The device ID format to use

        Note


        Only the system-name device ID format is supported


      • The maximum hold time for neighbor information
      • The refresh time for sending advertisements

      Note


      You can view output from the upstream Catalyst 6500 Series switch by using the show cdp neighbor command.


      Before You Begin

      Before beginning this procedure, be sure you know the following information:

      • How long you want CDP to retain neighbor information if you are setting the holdtime.
      • How often you want CDP to advertise if you are setting the CDP timer.
      Procedure
         Command or ActionPurpose
        Step 1switch# config t  

        Places you in global configuration mode.

         
        Step 2switch(config)# cdp format device-id system-name  (Optional)

        Specifies that CDP uses the system name for the device ID format.

         
        Step 3switch(config)# show cdp neighbors 

        Displays your device from the upstream device.

         
        Step 4switch(config)# show cdp neighbors 

        Displays the upstream device from your device.

         
        Step 5switch(config)# cdp holdtime seconds  (Optional)
        Sets the maximum amount of time that CDP holds onto neighbor information before discarding it.
        • The range for the seconds argument is from 10 to 255 seconds.
        • The default is 180 seconds.
         
        Step 6switch(config)# cdp timer seconds  (Optional)
        Sets the refresh time for CDP to send advertisements to neighbors.
        • The range for the seconds argument is from 5 to 254 seconds.
         
        Step 7switch(config)# show cdp global   (Optional)

        Displays the CDP version that is being advertised or sent to other devices.

         
        Step 8switch(config)# copy running-config startup-config  (Optional)

        Copies the running configuration to the startup configuration.

         
        switch# config t
        switch(config)# cdp format device-id system-name 
        switch# show cdp neighbors
        Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                          S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
        
        Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
        
        02000c000000     Gig 1/16          14             S       Soft Swit Eth 2/4
        02000c000000     Gig 1/17          14             S       Soft Swit Eth 2/5
        02000c000000     Gig 1/14          14             S       Soft Swit Eth 2/2
        02000c000000     Gig 1/15          14             S       Soft Swit Eth 2/3
        02000c000000     Gig 1/18          13             S       Soft Swit 
        switch(config)# show cdp neighbors 
        Capability Codes: R - Router, T - Trans-Bridge, B - Source-Route-Bridge
                          S - Switch, H - Host, I - IGMP, r - Repeater,
                          V - VoIP-Phone, D - Remotely-Managed-Device,
                          s - Supports-STP-Dispute
        
        Device ID              Local Intrfce   Hldtme  Capability  Platform      Port ID
        
        swordfish-6k-2         Eth2/2          169     R S I    WS-C6503-E    Gig1/14 
        swordfish-6k-2         Eth2/3          139     R S I    WS-C6503-E    Gig1/15 
        swordfish-6k-2         Eth2/4          135     R S I    WS-C6503-E    Gig1/16 
        swordfish-6k-2         Eth2/5          177     R S I    WS-C6503-E    Gig1/17 
        swordfish-6k-2         Eth2/6          141     R S I    WS-C6503-E    Gig1/18 
        switch(config)# cdp holdtime 10
        switch(config)# cdp timer 5
        switch(config)# show cdp global 
        Global CDP information:
            CDP enabled globally
            Sending CDP packets every 5 seconds
            Sending a holdtime value of 10 seconds
            Sending CDPv2 advertisements is disabled
            Sending DeviceID TLV in Mac Address Format
        switch(config-if)# copy running-config startup-config

        CDP Interface Configuration

        This section includes the following procedures:

        • Enabling CDP on an Interface
        • Disabling CDP on an Interface

        Enabling CDP on an Interface

        Although CDP is enabled by default on all interfaces, should it become disabled, you can use this procedure to enable it again.

        Procedure
           Command or ActionPurpose
          Step 1switch# config t  

          Places you in global configuration mode.

           
          Step 2switch(config)# interface interface-type number  

          Places you in interface configuration mode for the specific interface.

           
          Step 3switch(config-if)# no cdp enable 

          Disables CDP on this interface.

           
          Step 4switch(config-if)# cdp enable 

          Enables CDP on this interface.

           
          Step 5switch(config-if)# show cdp interface interface-type number  (Optional)

          Displays CDP information for the specified interface.

           
          Step 6switch(config)# copy running-config startup-config  (Optional)

          Copies the running configuration to the startup configuration.

           
          switch# config t
          switch(config)# interface port-channel 2
          switch(config-if)# no cdp enable 
          switch(config-if)# cdp enable
          switch(config-if)# show cdp interface mgmt0
          mgmt0 is up
              CDP disabled on interface
              Sending CDP packets every 60 seconds
              Holdtime is 180 seconds
          switch(config)# copy running-config startup-config

          Disabling CDP on an Interface

          Before You Begin

          Before beginning this procedure, be sure of the following:

          • CDP is currently enabled on the device.

            Note


            If CDP is disabled on the device, it is also disabled for all interfaces.


          • CDP is currently enabled on the specific interface you want to configure.
          Procedure
             Command or ActionPurpose
            Step 1switch# config t  

            Places you in global configuration mode.

             
            Step 2switch(config)# interface interface-type number  

            Places you in interface configuration mode for the specific interface.

             
            Step 3switch(config-if)# no cdp enable 

            Disables CDP on this interface.

             
            Step 4switch(config-if)# show cdp interface interface-type number  (Optional)

            Displays CDP information for the specified interface.

             
            Step 5switch(config)# copy running-config startup-config  (Optional)

            Copies the running configuration to the startup configuration.

             
            switch# config t
            switch(config)# interface mgmt0
            switch(config-if)# no cdp enable 
            switch(config-if)# show cdp interface mgmt0
            mgmt0 is up
                CDP disabled on interface
                Sending CDP packets every 60 seconds
                Holdtime is 180 seconds
            switch(config)# copy running-config startup-config

            Monitoring CDP

            Command

            Purpose

            show cdp traffic interface interface-type slot/port

            Displays the CDP traffic statistics on an interface.

            Clearing CDP Statistics

            Use one of the following commands to clear CDP statistics:

            Command

            Purpose

            clear cdp counters

            Clears CDP statistics on all interfaces.

            clear cdp counters interface number

            Clears CDP statistics on the specified interface.

            clear cdp table

            Clears the CDP cache for one or all interfaces.

            Verifying the CDP Configuration

            Use one of the following commands to verify the configuration:

            Command

            Purpose

            show cdp all

            Displays all interfaces that have CDP enabled.

            show cdp entry {all | name entry-name}

            Displays the CDP database entries.

            show cdp global

            Displays the CDP global parameters.

            show cdp interface interface-type slot/port

            Displays the CDP interface status.

            show cdp neighbors {detail | interface interface-type slot/port}

            Displays the CDP neighbor status.

            Configuration Example for CDP

            This example shows how to enable the CDP feature and configures the refresh and hold timers:

            switch# config t
            switch(config)# cdp enable
            switch(config)# cdp timer 50
            switch(config)# cdp holdtime 100

            Feature History for CDP

            Feature

            Releases

            Feature Information

            CDP

            4.0(4)SV1(1)

            This feature was introduced.