- Community Home
- >
- Networking
- >
- Switching and Routing
- >
- Comware Based
- >
- How to know MAC for specific port
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2014 04:58 PM - last edited on тАО07-03-2014 07:31 PM by Lisa198503
тАО07-02-2014 04:58 PM - last edited on тАО07-03-2014 07:31 PM by Lisa198503
How to know MAC for specific port
Hi.
I have 52 units of A5120-EI switch and time to time, i need to know where some MAC address are connected. Is there any way to do that by command line or SNMP?
I've tried the command "display mac-address <mac>" and I've got the port.....but is not the right way. Way? Because, as I think, it's a MAC-table of know hosts, not the MAc os connected device on specific port.
For example: I have switchs: A------B-----C. My computer is connected to switch A and switch C doesn't have anything connected, except the 'link' in port 1, witch is in 'hybrid' mode aloowing X,Y,Z VLAN's.
After some time and after connecting on all Switchs from my computer to manage it, if I go to console on switch C and so this: "display mac-address <my mac>", I got all mac-address learned from other switchs, including my computer MAC......all saying that is know from port 1 (link port). With this, I can't find where my MAc is connected.
Is there any other way to do that? Of corse, I know the MAC address. My initial idea is to make an script with will connect on all my switchs, one by one, and do some commands to discovery if the specific MAC address are connected to that switch or not.
By the way, I'm not interested in any software. I need to implement this in my current system using any kind of connection; ssh, telnet, SNMP, etc...
Thanks!!
P.S. This thread has been moved from Switches, Hubs, Modems (Legacy ITRC forum) to Comware-Based. -HP Forum Moderator
- Tags:
- A5120
- MAC address
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2014 12:12 PM
тАО07-03-2014 12:12 PM
Re: How to know MAC for specific port
The command :
dis mac-add aaaa-bbbb-cccc
... should display the interface where that mac-address was last seen. If this turns out to be a link to another switch, then you just repeat the process on that switch (and the next...) until you find the interface in question.
Is this a process that you need to perform frequently, and therefore wish to script?
Regards,
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2014 02:55 PM
тАО07-03-2014 02:55 PM
Re: How to know MAC for specific port
The function of the MAC forwarding table is so that data for that destination address is forwarded out that particular port, rather than flooded to all of them. This includes anything connected via an uplink to another switch.
If you want to find local machines, you have to discount ports connected to other switches. One way of doing that is by doing 'display lldp neighbor-information', assuming all your switches are running LLDP.
Needless to say, this should all be available through SNMP. However, it can take a while poking around to extract all the data and get it into a useful form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2014 03:41 AM
тАО07-04-2014 03:41 AM
Re: How to know MAC for specific port
If you do port-security and enable "port-security trap" you will get SNMP traps when a new client is being identified, check this thread for more info:
http://h30499.www3.hp.com/t5/Comware-Based/Port-Security-on-A5500/td-p/6472778
You can also add these lines to your config to get a log entry through syslog when a new mac-address is being identified (along with which device identified it and for which physical interface):
mac-address information enable
mac-address information queue-length 0
mac-address information mode syslog
mac-flapping notification enable
The log entry will look something like:
Fri Jul 04 03:01:41 2014: <190>2014-07-04T03:01:41 SW1 %%10MAC/6/MAC_INFORMATION(l): -DevIP=1.2.3.4-Action=Added-MacAddr=aaaa-bbbb-cccc-VlanID=123-MACType=1-IfName=GigabitEthernet1/0/1; MAC address table changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2014 11:33 AM
тАО07-04-2014 11:33 AM
Re: How to know MAC for specific port
Tks for all answers!
I've made a script that run searching on all my switchs and to 'filter' those uplink ports, I'm using port-type. Ex: If MAC is found on port X and this port is of type 'trunk', ignore and keep searching.
It's working pretty good :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2014 03:47 PM
тАО07-04-2014 03:47 PM
Re: How to know MAC for specific port
Sorry I missed that in order for the "mac-address information" to work you need to add this to the interface you wish to enable logging for:
mac-address information enable added
However if you already do port-security (and have configured that traps is sent as syslog aswell) the "mac-address information" might be redundant...