07-16-2020 02:38 AM
Hi all,
I'm currently using a C887VAG-4G-GA-K9 with the cellular as backup. To activate the cellular as back-up I use a script. This usually works just fine, but the router recently started flapping..
This activated the script over and over again.
This made both connections utterly useless. I am new to 4G back-up and scripts, so would like to ask if there is another way to make sure flapping doesn't make the script useless...
This is the script I'm using:
event manager applet Dialer0-UP
event syslog pattern "bound to profile Di0"
action 01 cli command "enable"
action 02 cli command "conf t"
action 03 cli command "no ip route 0.0.0.0 0.0.0.0 Cellular0 name BACKup"
action 04 cli command "ip route 0.0.0.0 0.0.0.0 dialer 0 name DEFAULT"
action 05 cli command "end"
action 06 syslog msg "Rerouting to primary link completed"
event manager applet Dialer0-down
event syslog pattern "unbound from profile Di0"
action 01 cli command "enable"
action 02 cli command "conf t"
action 03 cli command "no ip route 0.0.0.0 0.0.0.0 dialer 0"
action 04 cli command "ip route 0.0.0.0 0.0.0.0 Cellular0 name BACKup"
action 05 cli command "do ping 8.8.8.8 source vlan 1"
action 06 cli command "end"
action 07 syslog msg "Rerouting to secondary link completed"
!
This is a working solution, unless the line is flapping. Any addition to the script or other 'back-up activation method' would be highly appreciated.
Stay safe!
Greetings
Marnix
Solved! Go to Solution.
07-16-2020 04:57 AM
Hello,
the 'traditional' way to achieve the failover is to use an IP SLA and tracking for the primary route. Below is what that looks like:
track 1 ip sla 1 reachability
!
ip sla 1
icmp-echo 8.8.8.8 source-interface Dialer0
timeout 1000
threshold 2
frequency 3
!
ip sla schedule 1 life forever start-time now
!
ip route 0.0.0.0 0.0.0.0 Dialer0 track 1
ip route 0.0.0.0 0.0.0.0 Cellular0 10
ip route 8.8.8.8 255.255.255.255 Dialer0
!
event manager applet CLEAR_NAT
event track 1 state any
action 1.0 cli command “enable”
action 2.0 cli command “clear ip nat translation *”
action 3.0 cli command "end"
07-16-2020 04:57 AM
Hello,
the 'traditional' way to achieve the failover is to use an IP SLA and tracking for the primary route. Below is what that looks like:
track 1 ip sla 1 reachability
!
ip sla 1
icmp-echo 8.8.8.8 source-interface Dialer0
timeout 1000
threshold 2
frequency 3
!
ip sla schedule 1 life forever start-time now
!
ip route 0.0.0.0 0.0.0.0 Dialer0 track 1
ip route 0.0.0.0 0.0.0.0 Cellular0 10
ip route 8.8.8.8 255.255.255.255 Dialer0
!
event manager applet CLEAR_NAT
event track 1 state any
action 1.0 cli command “enable”
action 2.0 cli command “clear ip nat translation *”
action 3.0 cli command "end"
07-17-2020 03:20 AM
Thank you for your reaction.
Could you explain to me why? And should this be added or instead off?
Thanks in advance
07-17-2020 04:02 AM
Hello,
tracking in combination with an IP SLA is the standard way to configure backup connections. Your script essentially does the same thing. You can either configure a delay in your EEM sript, or change the frequency of the IP SLA in order to deal with the flapping.
08-21-2020 01:32 AM
Thank you very much for you reply! Sorry it took awile for me to respond, but I will look in to this when work is less busy!
Thanks again!
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