cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
179473
Views
23
Helpful
7
Replies

View device IP/MAC information connected to a specific port?

kevin.mcguire
Level 1
Level 1

Hi,

How can I view the devices (IP Address/MAC address) connected to each port on the switch?  I've seen a demo of thsibefore, but can't recall where to to go to view the information.

Thanks!

7 Replies 7

faizanahmed93
Level 1
Level 1

To view all the IP addresses connected to the switch

1) go to Priviledge mode by the command "enable"

2) now type the command

      hostname#show ip interface brief

To view the MAC address of the devices type the command

  hostname#show mac-address-table

 

This will show you all the ip addresses and mac addresses of the devices connected to the ports respectively.

Regards,

Faizan Ahmed

 

Spooster IT services

Hope this answers the question.

In addition to this a L2 switch with a L2 port will not show the IP address based on its port, but on its SVI at most:

castle-sw1#sh mac address-table | i Fa0/5
8 00c0.b799.f1a1 DYNAMIC Fa0/5

castle-sw1#sh ip arp | i 00c0.b799.f1a1
Internet 10.1.1.1 7 00c0.b799.f1a1 ARPA Vlan8

to me finding the MAC and IP on a port has always been a 2 step process.  Still +3 though  ;-)

Please remember to rate useful posts, by clicking on the stars below.

SW3850LAB#traceroute mac 54bf.6471.b5ef 14b3.1f1b.ec98 Error: Source Mac address not found. Layer2 trace aborted.

HOSTNAME #show ip interface brief
Interface IP-Address OK? Method Status Protocol
Vlan1 unassigned YES NVRAM administratively down down
Vlan99 10.165.128.42 YES NVRAM up up
FastEthernet0 unassigned YES NVRAM administratively down down
GigabitEthernet1/0/1 unassigned YES unset down down
GigabitEthernet1/0/2 unassigned YES unset up up
GigabitEthernet1/0/3 unassigned YES unset up up
GigabitEthernet1/0/4 unassigned YES unset up up
GigabitEthernet1/0/5 unassigned YES unset up up
GigabitEthernet1/0/6 unassigned YES unset up up
GigabitEthernet1/0/7 unassigned YES unset up up
GigabitEthernet1/0/8 unassigned YES unset administratively down down
GigabitEthernet1/0/9 unassigned YES unset up up
GigabitEthernet1/0/10 unassigned YES unset up up
GigabitEthernet1/0/11 unassigned YES unset up up
GigabitEthernet1/0/12 unassigned YES unset down down
GigabitEthernet1/0/13 unassigned YES unset up up
GigabitEthernet1/0/14 unassigned YES unset up up
GigabitEthernet1/0/15 unassigned YES unset down down
GigabitEthernet1/0/16 unassigned YES unset down down
GigabitEthernet1/0/17 unassigned YES unset down down
GigabitEthernet1/0/18 unassigned YES unset down down

Why am I getting unassigned .  I know there are assigned IP's on those ports

 

Michal Bruncko
Level 4
Level 4

hi Kevin

this possibility of collecting both MAC and IP info depends on role of your switch. Normally switch is L2 device working with MAC addresses and without care of L3 (IP addresses) layer. But in case you are running your device in L3 mode, you can collect IP addresses as well. All this MAC/IP collection has to be created from two databases:

  • MAC addresses from MAC address table (show mac-address inteface XXX)
  • IP addresses from ARP table (it contains both MAC and IP, but without info about physical interface) of switch (show arp)(again, only in case we talking about L3-mode of switch where switch stands like default gateway for all connected devices).

now you can relate both tables with matching MAC address records in both of them.

for automate collection you can use two options:

  • SNMP protocol and querying ARP and MAC address MIB tables, or
  • using script which connects to switch via telnet/ssh and using commands above collects from output desired information

I can tell you the first option (SNMP) is much more easier as you are just doing queries similar to database queries. 

If your switch is in L2 mode, then another option could be:

  • collect MAC addresses same way like with L3 switch, and
  • collect IP addresses either:
    • from DHCP server leased file which assigns IPs to connected devices, or
    • from your router/gateway device

oldcavalheiro
Level 1
Level 1

inside switch i used the command "show cdp neighbor" it show devices id/name connected in their respectives switchport. (display information about neighbors).
then access the device you want and get his ip/mac.