LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 12-17-2007, 06:24 PM   #1
creatorrr
Member
 
Registered: Nov 2007
Posts: 40

Rep: Reputation: 15
Howto find what device is connected to given switchport


This might be a pure networking question. We have Cisco switches and what i am trying to do is to find out what host is connected to given a switchport. The switcport belongs to a VLAN. I am wondering if it is posible to do that without tracing the cables. If i know the procedure, i might be able to create a shell script which will automatically do that.

e.g. Interface (switchport) fa2/0/17 is constantly going up and down. I want to be able to find out what host is connnected to this interface without tracing the physical cable. Is that posible?

Any thoughts?

Thank You
 
Old 12-17-2007, 06:51 PM   #2
harry edwards
Member
 
Registered: Nov 2007
Location: Lincolnshire, UK
Distribution: CentOS, Fedora, and Suse
Posts: 365

Rep: Reputation: 48
Most switches have a management interface - normally presented over Http or Serial. This menu system within this interface may assist you. Also some switch have a designated port for management tasks, such as packet logging.

Another approach is to unplug the cable (very quickly) and install a hub, then network sniff the traffic to and from the port.
 
Old 12-17-2007, 07:08 PM   #3
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,590

Rep: Reputation: 187Reputation: 187
I am unsure whether you know the host name and want to find the corresponding switchport or if you know the switchport and want to find the corresponding host name. If you know the host name you might be able to find what you want with the traceroute command. See:

man traceroute

---------------------------
Steve Stites
 
Old 12-17-2007, 07:15 PM   #4
creatorrr
Member
 
Registered: Nov 2007
Posts: 40

Original Poster
Rep: Reputation: 15
I know the switchport, want to find hostname or IP or Mac address of the coresponding host, anything. Would like to avoid tracing the cable or packet sniffing utilities, if that is posible...
 
Old 12-17-2007, 08:51 PM   #5
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Quote:
Originally Posted by creatorrr View Post
I know the switchport, want to find hostname or IP or Mac address of the coresponding host, anything. Would like to avoid tracing the cable or packet sniffing utilities, if that is posible...
show vlan - will show you switchport to vlan mapping.

show mac-address-table - will show you the learned MAC address of each device connected to the switch ports along with MAC addresses learned from other VLAN's via any trunked ports.

show arp - will tell you the IP address to MAC mapping. But if the switch is configured as layer 2 only, then show arp will not be of much use.

FWIW: When I see switchports flapping (as compared to a routing protocol like OSPF flapping), its usually one of the following:

1) Cable is bad (rj45 pins might be corroded, bad crimp on pins 1,2,3,6)
2) NIC card of device connected to flapping port
3) Speed mismatch (set the speed/duplex manually at both ends)

There are other possibilities that might cause port flapping, but I always check the above first. Especially the cable and NIC
 
Old 12-17-2007, 10:04 PM   #6
creatorrr
Member
 
Registered: Nov 2007
Posts: 40

Original Poster
Rep: Reputation: 15
Ok there is a progress:

sh mac address-table | include Fa2/0/46 would give me the Mac address of the host. Now the question is how to get the IP or hostname. Probably not posible from the router? Please note that the mac address may not be in the arp table or i may not be connected to the same vlan...

from the hints, 1. tried and no cnahge. 2 seems to be OK, even updated the latest driver the NIC seems to fine. 3. Just changed to manually 100/full on both interfaces and will see if there is any progress

thanks scowles

Last edited by creatorrr; 12-17-2007 at 10:08 PM.
 
Old 12-17-2007, 10:36 PM   #7
creatorrr
Member
 
Registered: Nov 2007
Posts: 40

Original Poster
Rep: Reputation: 15
OK i can find out from DHCP table...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I find connected users? adham1sa Linux - Networking 6 09-11-2009 04:44 PM
How to find out which clients are connected to a WLAN ozymandias Linux - Wireless Networking 2 12-09-2006 04:55 AM
UL 1.0 GRUB: could not find device for /boot: not found or not a block device cma Linux - General 4 12-12-2005 04:35 AM
find out which users are connected??? lemay_jeff Linux - Newbie 2 06-15-2004 11:14 AM
unable to find any workgroups when only 2 pc are connected morrissey Linux - Networking 0 02-27-2004 03:37 PM


All times are GMT -5. The time now is 11:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration