思科路由器接口联动脚本

需求:

以思科ISR4431为例,在一个接口down的时候触发另一个接口down

比如监控路由器上 G0/0/2接口协议down,则自动将G0/0/1设置为down。

G0/0/2接口协议up,则自动将G0/0/1设置为up。

实现步骤:

track 1 interface GigabitEthernet 0/0/2 line-protocol

event manager applet cisco
event track 1 state down
 action 0 syslog msg "EEM running SHUTDOWN G0/0/1"
 action 1 cli command "enable"
 action 2 cli command "config ter"
 action 3 cli command "int Gi 0/1/1"
 action 4 cli command "shutdown"
 action 5 cli command "end"

event manager applet cisco2
event track 1 state up
 action 0 syslog msg "EEM running NO SHUTDOWN G0/0/1"
 action 1 cli command "enable"
 action 2 cli command "config ter"
 action 3 cli command "int Gi 0/1/1"
 action 4 cli command "no shutdown"
 action 5 cli command "end"

Guess you like

Origin blog.csdn.net/netlt/article/details/121332873