Configuring CDP

Configuring CDP mode

To set the CDP mode to pass-through or receive only, enter this command.


[no]cdp moden[pass-through|rxonly]

Sets the selected mode of CDP processing.

Configuring CDPv2 for voice transmission

Legacy Cisco VOIP phones only support manual configuration or using CDPv2 for voice VLAN auto-configuration. LLDP-MED is not supported. CDPv2 exchanges information such as software version, device capabilities, and voice VLAN information between directly connected devices such as a VOIP phone and a switch.

When the Cisco VOIP phone boots up (or sometimes periodically), it queries the switch and advertises information about itself using CDPv2. The switch receives the VOIP VLAN Query TLV (type 0x0f) from the phone and then immediately sends the voice VLAN ID in a reply packet to the phone using the VLAN Reply TLV (type 0x0e.) The phone then begins tagging all packets with the advertised voice VLAN ID.

[NOTE: ]

NOTE: A voice VLAN must be configured before the voice VLAN can be advertised. For example, to configure VLAN 10 as a voice VLAN tagged for ports 1 through 10, enter these commands:

(HP_Switch_name#) vlan 10
HP Switch(vlan-10)# tagged 1-10
HP Switch(vlan-10)# voice
HP Switch(vlan-10)# exit

The switch CDP packet includes these TLVs:

  • CDP Version: 2

  • CDP TTL: 180 seconds

  • Checksum

  • Capabilities (type 0x04): 0x0008 (is a switch)

  • Native VLAN: The PVID of the port

  • VOIP VLAN Reply (type 0xe): voice VLAN ID (same as advertised by LLDPMED)

  • Trust Bitmap (type 0x12): 0x00

  • Untrusted port COS (type 0x13): 0x00

CDP should be enabled and running on the interfaces to which the phones are connected. Use the cdp enable and cdp run commands.

The pre-standard-voice option for the cdp mode command allows the configuration of CDP mode so that it responds to received CDP queries from a VoIP phone.


[no]cdp mode pre-standard-voice [admin-status <PORT-LIST> [tx_rx | rxonly]]

Enable CDP-compatible voice VLAN discovery with pre-standard VoIP phones. In this mode, when a CDP VoIP VLAN query is received on a port from pre-standard phones, the switch replies back with a CDP packet that contains the VID of the voice VLAN associated with that port.


Enables CDP-compatible voice VLAN discovery with pre-standard VoIP phones.


Sets the port in either transmit and receive mode, or receive mode only.

Default: tx-rx.


Sets this port in transmit and receive mode, or receive mode only.


Enable receive-only mode of CDP processing.


Enable transmit and receive mode.

[NOTE: ]

NOTE: Not recommended for phones that support LLDP-MED.


(HP_Switch_name#) cdp mode pre-standard-voice admin-status A5 rxonly


Show CDP output when CDP Run is disabled.

HP Switch (config#) show cdp
Global CDP information
Enable CDP [yes] : no


show cdp output when cdp run and sdp mode are enabled.

(HP_Switch_name#) show cdp
Global CDP Information
Enable CDP [Yes] : Yes
CDP mode [rxonly] : pre-standard-voice
CDP Hold Time [180] : 180
CDP Transmit Interval [60] : 60
Port CDP admin-status
---- --------- ------------
A1   enabled   rxonly
A2   enabled   tx_rx
A3   enabled   tx_rx


show cdp output when cdp run and cdp mode rxonly are enabled. When CDP mode is not pre-standard voice, the admin-status column is note displayed.

(HP_Switch_name#) show cdp
Global CDP Information
Enable CDP [Yes} : Yes
CDP mode [rxonly] : rxonly
Port CDP
---- --------
A1   enabled
A2   enabled
A3   enabled


show running-config when admin-status is configured.

(HP_Switch_name#) show running-config
Running configuration:
; J9477A Configuration Editor; Created on release #K.16.09.0000x
; Ver #03:01:1f:ef:f2
hostname “HPSwitch”
module 1 type J9307A
cdp mode pre-standard-voice admin-status A5 RxOnly

Enabling or disabling CDP operation on individual ports

In the factory-default configuration, the switch has all ports enabled to receive CDP packets. Disabling CDP on a port causes it to drop inbound CDP packets without recording their data in the CDP Neighbors table.


[no] cdp enable [ [ e ] <PORT-LIST> ]


To disable CDP on port A1:

(HP_Switch_name#) no cdp enable a1

Enabling and Disabling CDP Operation

Enabling CDP operation (the default) on the switch causes the switch to add entries to its CDP Neighbors table for any CDP packets it receives from other neighboring CDP devices.

Disabling CDP operation clears the switch's CDP Neighbors table and causes the switch to drop inbound CDP packets from other devices without entering the data in the CDP Neighbors table.


[no] cdp run

Enables or disables CDP read-only operation on the switch.

(Default: Enabled)


To disable CDP read-only on the switch:

(HP_Switch_name#) no cdp run

When CDP is disabled:

  • show cdp neighbors displays an empty CDP Neighbors table

  • show cdp displays

    Global CDP information

    Enable CDP [Yes]: No

Filtering CDP information

In some environments it is desirable to be able to configure a switch to handle CDP packets by filtering out the MAC address learns from untagged VLAN traffic from IP phones. This means that normal protocol processing occurs for the packets, but the addresses associated with these packets is not learned or reported by the software address management components. This enhancement also filters out the MAC address learns from LLDP and 802.1x EAPOL packets on untagged VLANs.

The feature is configured per-port.

Viewing the current CDP configuration of the switch

CDP is shown as enabled/disabled both globally on the switch and on a per-port basis.


show cdp

Lists the global and per-port CDP configuration of the switch.


Show CDP with the default CDP configuration

This example shows the default CDP configuration.

(HP_Switch_name#) show cdp

 Global CDP information

  Enable CDP [Yes] : Yes (Receive Only)

  Port CDP
  ---- --------
  1    enabled
  2    enabled
  3    enabled
  .      .
  .      .
  .      .

Viewing the current CDP neighbors table of the switch

Devices are listed by the port on which they were detected.


show cdp neighbors

Lists the neighboring CDP devices the switch detects, with a subset of the information collected from the device's CDP packet.

[ [ e ] port-numb [ detail ] ]

Lists the CDP device connected to the specified port. (Allows only one port at a time.)

Using detail provides a longer list of details on the CDP device the switch detects on the specified port.

[ detail [ [ e ]port-num ] ]

Provides a list of the details for all of the CDP devices the switch detects.

Using port-num produces a list of details for the selected port.


CDP neighbors table listing

This example displays the CDP devices that the switch has detected by receiving their CDP packets.

(HP_Switch_name#) show cdp neighbors

 CDP neighbors information

  Port Device ID                     | Platform                     Capability
  ---- ----------------------------- + ---------------------------- -----------
  1    Accounting (0030c1-7fcc40)    | J4812A HP Switch. . .        S
  2    Resear¢1-1 (0060b0-889e43)    | J4121A HP Switch. . .        S
  4    Support (0060b0_761a45)       | J4121A HP Switch. . .        S
  7    Marketing (0030c5_33dc59)     | J4313A HP Switch. . .        S
  12   Mgmt NIC(099a05-09df9b        | NIC Model X666               H
  12   Mgmt NIC(099a05-09df11        | NIC Model X666               H