由于设备限制,目前使用g0/1、g0/2及loopback0接口测试,当g0/1接口down之后,则g0/2及loopback0接口也随之down,如果g0/1接口Up,则g0/2及loopback0接口也随之Up。g0/1接口使用loopback internal命令使其Up,取消接口回环,测试未g0/1接口Down。
操作过程:
1、通过命令查看g0/1、g0/2及loopback0接口都是Up的
[H3C-GigabitEthernet0/1]dis ip int brief
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP Address Description
Aux0 up down -- --
GE0/0 up up 10.153.42.93 --
GE0/1 up up 1.1.1.1 --
GE0/2 up up 192.168.1.1 --
Loop0 up up(s) 10.1.3.1 --
2、配置接口Up的策略
rtm cli-policy Up //有几个接口Up,则写几个这样的策略
event syslog priority all msg "Physical state on the interface GigabitEthernet0/1 changed to up" occurs 1 period 10 //标红处为接口up的log,您到时候查看一下具体log日志是什么,修改即可,
action 1 cli sys
action 2 cli int g0/2
action 3 cli undo shut
action 4 cli int loop0
action 5 cli undo shut
commit
3、配置接口Down的策略
rtm cli-policy Down //有几个接口Down,则写几个这样的策略
event syslog priority all msg "Physical state on the interface GigabitEthernet0/1 changed to down" occurs 1 period 10 //标红处为接口Down的log,您到时候查看一下具体log日志是什么,修改即可,
action 1 cli sys
action 2 cli int g0/2
action 3 cli shut
action 4 cli int loop0
action 5 cli shut
commit
测试过程:
1)取消g0/1接口的接口回环,使g0/1接口Down,并查看接口状态。
[H3C-GigabitEthernet0/1]undo loopback
[H3C-GigabitEthernet0/1]dis ip int brief
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP Address Description
Aux0 up down -- --
GE0/0 up up 10.153.42.93 --
GE0/1 down down 1.1.1.1 --
GE0/2 *down down 192.168.1.1 -- //此处两接口都已经down
Loop0 *down up(s) 10.1.3.1 --
Loop1 up up(s) 192.168.2.1 --
2)启用g0/1接口的接口回环,并查看接口的状态:
[H3C-GigabitEthernet0/1]loopback internal
Loop internal succeeded!
[H3C-GigabitEthernet0/1]dis ip int brief
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP Address Description
Aux0 up down -- --
GE0/0 up up 10.153.42.93 --
GE0/1 up up 1.1.1.1 --
GE0/2 up up 192.168.1.1 -- //接口已经Up
Loop0 up up(s) 10.1.3.1 --
注意事项
不同设备接口Up/Down的日志可能不同,需要先查看接口Up/Down的日志。
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论