01-05-2017 08:58 AM - edited 03-08-2019 08:48 AM
Could I Display like int gi 1/0/1, 1/0/2......
On Similar lines you can exclude specific interface when you run the command. Say I want to see all mac addresses in order of interface and exclude the trunk interface.
Thank you
01-05-2017 11:05 AM
I don't think there is a way to have the output display in the order of interface, but if you wan to see the mac address table on a switch and exclude the uplink trunk port you can use the pipe with the proper interface modifier.
So if you had a 4500 switch with G1/5 being the uplink and you wanted to omit that from the output it would be:
sh mac address-table | exclude GigabitEthernet1/5
If you had two uplinks one being G1/3 and 1/5 then it would be:
sh mac address-table | exclude GigabitEthernet1/[3,5]
There's a ton of ways of doing regular expressions, but this should give you an idea.
Hope this helps.
01-05-2017 03:20 PM
Hello Chris,
I tried but no luck
sh mac address-table | exclude GigabitEthernet 1/0/[47,48,49]
Thanks,
01-05-2017 04:27 PM
Try "sh mac address-table | exclude GigabitEthernet 1/0/[47-49]", if that doesn't work let me know the platform you are trying it on and if I have it available I'll try it out.
01-07-2017 03:51 AM
Ooops, should have been "sh mac address-table | exclude GigabitEthernet 1/0/[4][7-9]"
01-09-2017 08:04 AM
Hello Hussey,
Thank you for the pointing to right direction. You had a space after GigabitEthernet and after removing the space it worked. Thank you for the help.
sh mac address-table | exclude Gi1/0/47|1/0/48|1/0/49
sh mac address-table | exclude Gi1/0/[4][7-9]
If you can edit your answer, I will mark it correct
01-05-2017 01:00 PM
Hello,
I think you would need a TCL script and concatenate the output of different show commands, since you need the MAC addresses and the interfaces configured as trunks, and both won't show up in the same command output.
I'll see if I can get a script to work...
01-05-2017 03:22 PM
Hello Gpauwen,
It is not something mission critical, I was just hoping if there was easier way like SQL query using regex. So please don't spend extra time on this. I also don't have experience running TCL script against IOS.
Thanks,
01-06-2017 09:18 PM
Here how you can do it
If you would want to exclude interface Gi1/1/1-4
sh mac address-table | exclude Gi1/1/1|Gi1/1/2|Gi1/1/3|Gi1/1/4
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide