Identify from PC the directly connected IP Phone

Unanswered Question
Nov 27th, 2009


I need to automatically identify from a PC the IP Phone that is connected to. So, I would like to discover from PC the mac-address or the Device Name of that IP Phone. How could I do it?

I think one possibility could be the computer to listen to CDP packages. But if the PC receives all CDP packages of all devices trough the same interface, could it distinguish which phone is the directly connected to?

Other possibility would be ARP tables allocated in the switches, but I think it would be difficult to automate.

What do you think? Any idea?



I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Leo Laohoo Fri, 11/27/2009 - 14:36

If you configure switchport voice vlan and switchport access, then use the command "show mac- int ".  You should get two results:  One for the phone and one for the PC.

Does this help?

tzunt Fri, 11/27/2009 - 21:03

I think leolaohoo's method is sound.  There is a way to learn the phone's MAC address from the PC rather than the switch, although either would be tough to automate.  In the past when I wanted to monitor a IP phone's traffic from the attached PC, I enabled 'Span to PC Port' in the Device>Phone configuration record.

It is shown here:

Having enabled that option, I used a sniffer program (e.g. Wireshark) to analyze the phone's packets in addition to the PC's packets, and the IP phones MAC address was present in the packet capture.  Heck, you may simply be able to type ARP -A from a DOS window on the PC after enabling Span to PC port to see the MAC of the phone, but we'll have to wait to get back to work to try that one out.

christian.pinedo Mon, 11/30/2009 - 01:06

Thanks leolaohoo and tzunt for your ideas. As tzunt comments I think that leolaohoo suggestion is difficult to automate but not imposible (I'm thinking on a solution based on a web service, SOAP or XML-RPC, that recives as input the MAC address of the pc and returns the MAC address of the phone. The web service would use Expect scprinting language to launch telnet/SSH connections to Cisco switches and launch the needed commands)

tzunt solution should also be possible, but I would have to develop a mini-sniffer to see the phone traffic and so to discover the MAC address of the phone. I disagree with tzunt about I think that MAC address of the phone wouldn't be able on the ARP table of the PC and would be necessary to use the sniffer to discover the MAC address of the phone.

So at this point I only have two posible solutions:

- develop a sniffer

- use mac tables and cdp utilities of Cisco Switches

A third solution could be to develop a mini-application that talks CDP (Cisco Discovery Protocol) and would be executed from PC. But I don't know if Cisco have an API to do this, do you know?

Thanks again,


olcaytarazan Mon, 07/30/2012 - 06:27

Hi all,

I am also dealing with same problem.But we can't develop a sniffing application since we have account restrictions. How can I use mac tables or cdp utılıtıes of cisco switches.Basicly I need MAC Address of IP Phone from my PC.It shouldn't be complicated



Leo Laohoo Mon, 07/30/2012 - 15:20

Try this command:

conf t

ip device tracking


ip device tracking max 10


Wait for approximately 30 seconds, then try the command "sh ip device tracking all".

NOTE:  This set of commands will depend entirely upon your IOS version.

olcaytarazan Tue, 07/31/2012 - 01:08

Thanks for your reply.

I guess these are switch commands but I don't have access to switch. (Although I will tell the switch administrator to run these commands on switch if possible).

When I use wireshark on my PC, I can see CDP packages which has deviceID information for both soft and hard phone. So I guess, i can see MAC address of hardphone from my PC.But when I use 'arp -a', i cant. (I use windows 7)


This Discussion