Wednesday, May 11, 2011

Gathering Port and Interface Information in CDP

The show cdp interface command gives you the CDP status on router interfaces or switch ports. As i said earlier, you can turn off CDP completely on a router by using no cdp run command. But remember that you  can also turn off CDP on a per-interface basis with the no cdp enable command. You enable a port with the cdp enable command. All ports and interfaces default to cdp enable.

On a router, the show cdp interface command displays information about each interface using CDP, including the encapsulation on the line, the timer, and the holdtime for each interface. Here's an example of this command's output on the R1 Router.

R1#show cdp interface
FastEthernet0/0 is administratively down, line protocol is down
  Encapsulation ARPA
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
Serial1/0 is up, line protocol is up
  Encapsulation HDLC
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
Serial1/1 is up, line protocol is up
  Encapsulation HDLC
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
Serial1/2 is administratively down, line protocol is down
  Encapsulation HDLC
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
Serial1/3 is administratively down, line protocol is down
  Encapsulation HDLC
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds

The above output is nice because it always tells you the interface's status. To turn off CDP on one interface on a router, use the no cdp enable command from interface configuration mode:

R1#config terminal
R1(config)#int serial 1/0
R1(config-if)#no cdp enable

R1#show cdp interface
FastEthernet0/0 is administratively down, line protocol is down
  Encapsulation ARPA
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
Serial1/1 is up, line protocol is up
  Encapsulation HDLC
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
Serial1/2 is administratively down, line protocol is down
  Encapsulation HDLC
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds
Serial1/3 is administratively down, line protocol is down
  Encapsulation HDLC
  Sending CDP packets every 60 seconds
  Holdtime is 180 seconds

Notice that serial 1/0 isn't listed in the router output. To get that output, you'd have to perform a cdp enable on serial 1/0. It would show up in the output:

R1#config terminal
R1(config)#int serial 1/0
R1(config-if)#cdp enable


No comments:

Post a Comment