07-02-2014 01:16 PM
Hi Community,
I am trying to execute the following script by using EEM and it is failing due to the line 30 command requesting an answer. What do I need to do to either reply yes to the question or force the cli to continue without asking the question. The script stops everytime in line 30 due to the no ip nat statement requesting yes/no answer to remove the nat rule.
Kind regards
Here is the script:
event manager applet PRIMARY_WAN_DISABLE
event track 1 state down
action 0 cli command "enable"
action 10 cli command "configure terminal"
action 20 cli command "no ip route 0.0.0.0 0.0.0.0 189.208.32.1″
action 25 cli command "ip route 0.0.0.0 0.0.0.0 Dialer1"
action 30 cli command "no ip nat inside source list NAT interface FastEthernet1 overload″ --> After this line the scripts stops due to the yes/no question.
action 32 cli command "no ip nat inside source static tcp 10.0.42.240 80 interface FastEthernet1 5631″
action 35 cli command "ip nat inside source list NAT interface Dialer1 overload″
action 38 cli command "ip nat inside source static tcp 10.0.42.240 80 interface Dialer1 5631″
action 40 cli command "interface Tunnel1″
action 45 cli command "tunnel source Dialer1"
action 50 cli command "interface Tunnel2"
action 55 cli command "tunnel source Dialer1"
action 60 cli command "end"
action 65 cli command "write"
action 70 syslog msg "Traffic has been routed through SECONDARY_WAN"
07-03-2014 01:11 PM
Change the action to:
action 30 cli command "no ip nat inside source list NAT interface FastEthernet1 overload" pattern "yes"
action 31 cli command "yes"
This assumes the prompt contains the word "yes". If not, just replace the pattern with a keyword in the prompt.
08-08-2015 09:49 PM
08-09-2015 07:18 AM
What is the actual prompt you get when you type the command manually?
08-09-2015 10:42 AM
Hi Joseph Clarke.
I get "Static entry in use, do you want to delete child entries? [no]:"
08-09-2015 10:52 AM
Then change the action to:
action 30 cli command "no ip nat inside source list NAT interface FastEthernet1 overload" pattern "no"
08-10-2015 01:23 AM
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