Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

EEM execution failing due to CLI nat question

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"

 

 

 

 

Everyone's tags (2)
6 REPLIES
Cisco Employee

Change the action to: action

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.

New Member

Hi Joseph Clarke.I have try

Hi Joseph Clarke.

I have try it but eem don't work.

 

Cisco Employee

What is the actual prompt you

What is the actual prompt you get when you type the command manually?

New Member

Hi Joseph Clarke.I get

Hi Joseph Clarke.

I get "Static entry in use, do you want to delete child entries? [no]:"

Cisco Employee

Then change the action to

Then change the action to:

action 30 cli command "no ip nat inside source list NAT interface FastEthernet1 overload" pattern "no"


 

New Member

Hi Joseph Clarke.EEM work

Hi Joseph Clarke.

EEM work.

Thank you so much.

217
Views
5
Helpful
6
Replies
CreatePlease to create content