• Post Reply Bookmark Topic Watch Topic
  • New Topic

finding the switch port number an end station is connected to  RSS feed

 
william chaple
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys

Well I already know you can go into a cisco switch, and type in
show mac-address-table address <MAC address>

and it will show which interface the mac address is associated with; but is there a way to do this through a linux terminal?
im not saying arp to find mac address or ip, but as an example, I have a 50 port switch about 5 rooms away. I can not follow the cable and figure out which port it is on

rather than me telnet to the cisco switch, can I do something from the command prompt or use linux terminal to find which hosts are connected to what port number of a switch
 
Andrew Polansky
Ranch Hand
Posts: 310
18
Linux MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if I understand the question correctly, but cannot you simply use telnet from your Linux computer?
 
Tim Holloway
Saloon Keeper
Posts: 18797
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Telnet is an option. Linux also comes with arp/rarp display/cache management utilities.

Personally, I just "ping". Since Linux does a continuous ping unless otherwise instructed I have plenty of time to walk around to the switch and see which light is strobing.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam Scheller wrote:I am not sure if I understand the question correctly, but cannot you simply use telnet from your Linux computer?


Yea, "something from the command prompt or use linux terminal" instead of, or "rather than me telnet to the cisco switch" doesn't really makes sense, as "telnet" is a command ran from the command prompt...

Perhaps the OP meant something simpler to execute -- something that doesn't require a log in, or going through menus, or etc. etc. etc. In that case, how about an expect script? The OP can actually automate the telnet session via a script, so that it can be easier. Of course, that would mean that the OP would need to learn how to use "expect".

Henry
 
william chaple
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys sorry for the confusement


what I am trying to do is find out the workstation named "luna", what port number it is connected to? I need to change an ethernet cable from luna to the cisco switch, and I can not follow the cable. I can log on the cisco switch and see the mac / ip address associated to a certain interface, but i have to log on the switch


say I have a linux work station named "bigbear"; what can I do with bigbear in order to find out what port number luna is connected to on the cisco switch?
 
Tim Holloway
Saloon Keeper
Posts: 18797
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure that there's a universal solution. I'm not even sure that all switches present per-port MAC addresses, actually.

However, apparently Cisco will enumerate the port MAC addresses via SNMP if you can obtain credentials to query the switch. Linux and SNMP work well together. I use it to monitor my servers and routers. I even wrote a custom SNMP agent for a guy in Romania last fall.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!