配置步骤
#
bfd echo-source-ip 1.1.1.1
#
track 1 bfd echo interface GigabitEthernet0/0 remote ip 1.1.1.1 local ip 1.1.1.2
#
rtm cli-policy test
event track 1 state negative
action 1 cli system-view
action 2 cli interface GigabitEthernet 0/1
action 3 cli shutdown
user-role network-admin
or:
#
nqa entry admin test1
type icmp-echo
destination ip 1.1.1.1
frequency 100
reaction 1 checked-element probe-fail threshold-type consecutive 4 action-type trigger-only
#
nqa schedule admin test1 start-time now lifetime forever
#
rtm cli-policy test1
event track 1 state negative
action 1 cli system-view
action 2 cli interface GigabitEthernet 0/1
action 3 cli shutdown
user-role network-admin
#
track 1 nqa entry admin test1 reaction 1
配置关键点
[H3C-rtm-test]%Mar 19 23:55:07:513 2023 H3C IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet0/0 changed to down.
%Mar 19 23:55:07:513 2023 H3C IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet0/0 changed to down.
%Mar 19 23:55:12:085 2023 H3C BFD/5/BFD_CHANGE_FSM: Sess[1.1.1.2/1.1.1.1, LD/RD:33793/33793, Interface:GE0/0, SessType:Echo, LinkType:INET], Ver:1, Sta: UP->DOWN, Diag: 2 (Echo Function Failed)
%Mar 19 23:55:12:101 2023 H3C IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet0/1 changed to down.
%Mar 19 23:55:12:101 2023 H3C IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet0/1 changed to down.
%Mar 19 23:55:12:131 2023 H3C RTM/6/RTM_POLICY: CLI policy test is running successfully.
[H3C-rtm-test]
[H3C-rtm-test]dis ip int bri
*down: administratively down
(s): spoofing (l): loopback
Interface Physical Protocol IP address/Mask VPN instance Description
GE0/0 down down 1.1.1.2/24 -- --///上行口
GE0/1 *down down -- -- --///下行口