cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1594
Views
0
Helpful
2
Replies

Clear arp-cache on a trigger

Netnux
Level 1
Level 1

Good morning.

I need help on a task involving ARP.

I have a remote branch with two WAN connections:

- private network to the corporate Headquarters (MPLS, VPLS)
- local internet connection

The remote branch mainly use the internet through the local access, and I have managed to use the MPLS link as a backup internet connection using IP SLA.
When the primary internet link fails, the router route the traffic through the corporate link, and when the primary internet link comes back alive, the router fails-back on it.

Everything works fine, I can see the track going UP/Down and the routing table to change but... traffic flow doesn't change according the routing until I issue the command clear arp-cache.
Particularly in the fail-back operation.
And this behavior also has a lot of sense to me.

I also thought to dramatically reduce the arp cache refresh interval but...

... Is there a way to instruct the router to issue a clear arp-cache command after the route change?

Many thanks for your kind help
Regards

 

1 Accepted Solution

Accepted Solutions

Bilal Nawaz
VIP Alumni
VIP Alumni

You could use an EEM script to trigger on your SLA UP / DOWN.

e.g.

track 1 ip sla 1 reachability

!

event manager applet TRACK-1

event track 1 state down

action 0.1 cli command "enable"

action 0.2 cli command "clear arp-cache"

event track 1 state up

action 0.1 cli command "enable"

action 0.2 cli command "clear arp-cache"

Please rate useful posts & remember to mark any solved questions as answered. Thank you.

View solution in original post

2 Replies 2

Bilal Nawaz
VIP Alumni
VIP Alumni

You could use an EEM script to trigger on your SLA UP / DOWN.

e.g.

track 1 ip sla 1 reachability

!

event manager applet TRACK-1

event track 1 state down

action 0.1 cli command "enable"

action 0.2 cli command "clear arp-cache"

event track 1 state up

action 0.1 cli command "enable"

action 0.2 cli command "clear arp-cache"

Please rate useful posts & remember to mark any solved questions as answered. Thank you.


It works great!
I didn't know much about EEM scripting, I've never encountered it in any of the (more then a few) books I have read till here.
Thank you very much, I will start studying this topic.

Many many thanks for your precious help
regards

PS
Just for note
I didn't find the option to trigger on a track event.
Maybe It is because I tryed this on an old version IOS under GNS3 or for my poor experience on this topic.
Also the commands seemed a little different.
No matter, I trigger on the syslog pattern " %TRACKING-5-STATE: 10 rtr 10 reachability" (the same for up and down) and every works fine.

SW-GER-CORE#sh event manager history events
No.  Time of Event             Event Type          Name
1    Fri Mar 1  00:11:11 2002  syslog              applet: ClearARP
2    Fri Mar 1  00:15:06 2002  syslog              applet: ClearARP
3    Fri Mar 1  00:19:11 2002  syslog              applet: ClearARP
4    Fri Mar 1  00:23:06 2002  syslog              applet: ClearARP

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card