Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

finding the switch port number an end station is connected to

 
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
 
Ranch Hand
Posts: 310
18
MS IE Linux
  • 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?
 
Saloon Keeper
Posts: 22248
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
author
Posts: 23878
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux 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: 22248
151
Android Eclipse IDE Tomcat Server Redhat Java 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.

 
Dinner will be steamed monkey heads with a side of tiny ads.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic