Primary menu

Secondary menu

Use the CDP (Cisco Discovery Protocol) with Mac OS X

Introduction
CDP (Cisco Discovery Protocol) allows Cisco devices to be identified among them. For example, this system is used to find the IP address or port that is connected to another Cisco equipment. Broadly, this is a proprietary protocol that handles to send multicast information (every 60 seconds) to each device connected to accelerate identification.

For people who don’t have a Cisco network, there is another standardized protocol named LLDP offering more or less the same services. In our case we use the CDP because it is enabled by default on all our equipment (the LLDP integration is in another post).

Recovering the CDP information from our clients it is possible to quickly find the network location of each and to map automatically the infrastructure.

Compile cdpr for Mac OS XSeveral existing tools can retrieve the CDP information from a Mac. The solution that seems the easiest to use is available on Source Forge under the project name cdpr.

Before you begin this step, it is necessary to install Xcode from the Mac App Store and the “Command Line Tools”. These are in the Xcode preferences in the “Downloads”. This is required to get the GCC compiler to prepare a Mac version of cdpr.

– Download cdpr from the project site and unzip the files.
– Go from Terminal in the cdpr folder where are the sources of the application.

cd ~/Downloads/cdpr-2.4

– Run the command “make” to perform the compilation.

make

– If the command does not return an error, a new binary called “cdpr” is available in the directory. It can be moved more or less anywhere because it works without file dependency.

Usage
It is possible to use the software in two ways, the first is simply to run cdpr and an intuitive interface will open in Terminal. It will ask you to select the network interface that you want to display CDP information.

The software also supports the execution of the command by arguments to use information more easily in a script.