Today, I was facing an issue on a client network. After some troubleshooting, I was supposing that a MAC address was duplicated on the network and appears randomly on a physical interface.
But as I didn't would like pass my day to check the mac database of the switch for this specific interface, I have decided to use an EEM script. This EEM script detects new entry in MAC database for the specific interface and generates a log message with an alert level of priority. These levels messages are forwarded by the syslog server to my mailbox! Once I have received the message, I can check manually on the switch which MAC appears on the interface. Below, the script used in order to troubleshoot this issue:
event manager applet MAC-ADD
event mat interface GigabitEthernet0/24 type add
action 1.0 syslog priority alerts msg "NEW MAC on ADD Gi0/24"
!
event manager applet MAC-DEL
event mat interface GigabitEthernet0/24 type delete
action 1.0 syslog priority alerts msg "MAC DELETED on Gi0/24"
Showing posts with label MAC. Show all posts
Showing posts with label MAC. Show all posts
Thursday, October 23, 2014
Friday, October 18, 2013
MAC Flapping detection
By default, the command mac address-table notification mac-move is not configured on a 4k5. This command permits to detect a MAC flapping with a log message (see below generated logs):
#mac address-table notification mac-move
#mac address-table notification mac-move
Jul 9 08:12:26.707: %C4K_EBM-4-HOSTFLAPPING: Host A4:CA:DB:48:05:B0 in vlan 50 is moving from port Gi2/16 to port Gi2/18
Jul 9 08:12:28.111: %C4K_EBM-4-HOSTFLAPPING: Host A4:CA:DB:48:05:B0 in vlan 50 is moving from port Gi2/18 to port Gi2/16
Jul 9 08:12:28.499: %C4K_EBM-4-HOSTFLAPPING: Host A4:CA:DB:48:05:B0 in vlan 50 is moving from port Gi2/16 to port Gi2/18
Jul 9 08:12:28.519: %C4K_EBM-4-HOSTFLAPPING: Host A4:CA:DB:48:05:B0 in vlan 50 is moving from port Gi2/18 to port Gi2/16
Jul 9 08:12:28.111: %C4K_EBM-4-HOSTFLAPPING: Host A4:CA:DB:48:05:B0 in vlan 50 is moving from port Gi2/18 to port Gi2/16
Jul 9 08:12:28.499: %C4K_EBM-4-HOSTFLAPPING: Host A4:CA:DB:48:05:B0 in vlan 50 is moving from port Gi2/16 to port Gi2/18
Jul 9 08:12:28.519: %C4K_EBM-4-HOSTFLAPPING: Host A4:CA:DB:48:05:B0 in vlan 50 is moving from port Gi2/18 to port Gi2/16
If this command is not configured you will certainly detect the MAC flapping with a high CPU (if it's monitored!). When you detect a CPU peak, it's not trivial to detect the root cause. To determine whether it's a MAC flapping you can use the following command
C4510#show platform health
%CPU %CPU RunTimeMax Priority Average %CPU Total
Target Actual Target Actual Fg Bg 5Sec Min Hour CPU
RkiosObflMan 0.50 0.00 4 0 100 500 0 0 0 51:24
GalChassisVp-review 3.00 0.11 10 40 100 500 0 0 0 1260:27
S2w-JobEventSchedule 10.00 0.90 10 8 100 500 1 1 1 15025:10
...
K5L3Unicast Adj Chan 2.00 0.00 15 1 100 500 0 0 0 12:14
K5L3Unicast Adj Tabl 2.00 11.07 15 11 100 500 6 7 5 55618:52
K5L3AdjStatsMan Revi 2.00 0.15 10 11 100 500 0 0 0 3972:07
...
K5 L2 Unicast Addres 2.00 0.00 20 10 100 500 0 0 0 0:18
K5 L2 Multicast Addr 2.00 0.00 20 0 100 500 0 0 0 0:08
K5 L2 Hardware Addre 2.00 15.06 20 14 100 500 11 12 7 88117:09
As seen above, 2 variables are abnormally high:
- K5L3Unicast Adj Tabl: due to the ARP table refresh. a new MAC address is permanently associated to an IP address.
- K5 L2 Hardware Addre : the relation MAC/physical interface is also permanently refreshed.
To be sure, enter the command mac address-table notification mac-move and check the logs messages.
Subscribe to:
Posts (Atom)