Monday, March 20, 2017

EM script Dual ISP

track 130 interface GigabitEthernet0/0/0 line-protocol

interface GigabitEthernet0/0/0
description Isp1

ip route 0.0.0.0 0.0.0.0 10.10.10.1 name isp1
ip route 0.0.0.0 0.0.0.0 148.20.20.2 250 name isp2

event manager session cli username "xxxxxxxxx"
event manager applet  ISP-down
 event track 130 state down
 action 1.2 cli command "en"
 action 1.3 cli command "xxxxxxxx"
 action 1.5 cli command "conf t"
 action 1.6 cli command "no ip route 0.0.0.0 0.0.0.0 10.10.10.1 name ISP1"
 action 1.7 cli command "ip route 0.0.0.0 0.0.0.0 148.20.20.2 name ISP2"
 action 2.0 cli command "exit"
 action 2.5 syslog msg "Moved the traffic to ISP2"
event manager applet CTL-up
 event track 130 state up
 action 1.2 cli command "en"
 action 1.3 cli command "xxxxx"
 action 1.5 cli command "conf t"
 action 1.6 cli command "ip route 0.0.0.0 0.0.0.0 148.20.20.2 250 name ISP1"
 action 1.7 cli command "ip route 0.0.0.0 0.0.0.0 10.10.10.1 name ISP1"
 action 2.0 cli command "exit"
 action 2.5 syslog msg "Moved the traffic to ISP1"
!
end

No comments:

Post a Comment

Palo Alto firewall handy troubleshooting CLI commands

 > show interface management Show management Interface details > show system info Display system’s management IP, Serial number, and c...