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

EEM Script to update dynamic IP

raphaelbraga
Level 1
Level 1

Hi, I have created a GRE tunnel between a Cisco 2800 Router and Teltonia RUT240. The RUT240 doesn't support either GRE over IPSEC or DMVPN. The problem that I'm facing is that on the remote side (the RUT240) I have a dynamic IP, which is frequently updated, which is resolver by a DDNS hostname. I found researching on web, that the better solution for this scenario is to use EEM script and IS SLA (please corret me if I'm wrong). Here a part of what is currrently in my config file:

track 125 ip sla 125 reachability
  delay down 60 up 30
  exit
ip sla 125 
  icmp-echo posteib25.ddns.net
  threshold 2500
  timeout 2500
  frequency 60
  exit
ip sla schedule 125 life forever start-time now
  event manager applet Refresh-DDNS
  event track 125 state down
  action 01.0 cli command "enable"
  action 02.0 cli command "conf t"
  action 03.0 cli command "int tunn1"
  action 04.0 cli command "no tunnel destination"
  action 05.0 cli command "tunnel destination host2remote.ddns.net"
  action 06.0 cli command "exit"
  action 07.0 cli command "no ip sla 125"
  action 08.0 cli command "ip sla 125"
  action 09.0 cli command "icmp-echo host2remote.ddns.net"
  action 10.0 cli command "threshold 2500"
  action 11.0 cli command "timeout 2500"
  action 12.0 cli command "frequency 60"
  action 12.0 cli command "exit"
  action 13.0 cli command "no ip sla schedule 125 life forever start-time now"
  action 14.0 cli command "ip sla schedule 125 life forever start-time now"
  action 15.0 cli command "no track 125 ip sla 125 reachability"
  action 16.0 cli command "track 125 ip sla 125 reachability"
  action 17.0 cli command "delay down 60 up 30"

The tracking is working fine and the event manager is called as soon as I got 2 failures. The problem is that after the second failure, the event manager is not called again, so if the dynamic IP is not reachable on the first try, I will not be able to update the IP, and the failures keep increasing.

How can I fix the code so the event manager keeps trying to refresh the IP on each failure?

I'm not sure if I was clear, but if something is missing for the proper understading of the scenario, please let me know.

Thank you! 

0 Replies 0
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: