juniper路由器用rpm快速清理bgp邻居

cisco有ip sla,huawei/h3c 有nqa,juniper有rpm

以下为juniper rpm实践,快点清理bgp邻居

左边left路由器ibgp配置:

set routing-options router-id 10.5.245.41
set routing-options autonomous-system 65001
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 1.1.1.1
set protocols bgp group ibgp neighbor 3.3.3.3

右边right路由器ibgp配置:

set routing-options router-id 10.5.245.43
set routing-options autonomous-system 65001
set protocols bgp group ibgp type internal
set protocols bgp group ibgp local-address 3.3.3.3
set protocols bgp group ibgp neighbor 1.1.1.1

左边left路由器rpm配置:
 

services rpm probe bgp-mon test icmp-test probe-type icmp-ping
set services rpm probe bgp-mon test icmp-test target address 3.3.3.3
set services rpm probe bgp-mon test icmp-test probe-count 5
set services rpm probe bgp-mon test icmp-test probe-interval 3
set services rpm probe bgp-mon test icmp-test test-interval 5
set services rpm probe bgp-mon test icmp-test source-address 1.1.1.1
set services rpm probe bgp-mon test icmp-test thresholds total-loss 5

左边left路由器event-options policy配置:

set event-options policy clear-bgp-neighbor-ping-failure events ping_test_failed
set event-options policy clear-bgp-neighbor-ping-failure events ping_probe_failed
set event-options policy clear-bgp-neighbor-ping-failure attributes-match ping_test_failed.test-owner matches bgp-mon
set event-options policy clear-bgp-neighbor-ping-failure attributes-match ping_test_failed.test-name matches icmp-test
set event-options policy clear-bgp-neighbor-ping-failure then execute-commands commands "clear bgp neighbor 3.3.3.3"

左边left路由器设置日志以便观察:

set system syslog file interactive-commands interactive-commands any
set system syslog file daemon-info.log daemon info

验证:

right路由器上deactivate接口,模拟断线情况:
root@right# deactivate interfaces ge-0/0/1
root@right# commit

在左侧left路由器上观察bgp状态:

root@left# run show bgp neighbor | match State    
  Type: Internal    State: Active         Flags: <>
  Last State: Idle          Last Event: Start

在左侧left路由器上观察日志:

root@left> show log interactive-commands | last 20 
May 27 10:02:19  left mgd[35913]: UI_AUTH_EVENT: Authenticated user 'root' at permission level 'super-user'
May 27 10:02:19  left mgd[35913]: UI_LOGIN_EVENT: User 'root' login, class 'super-user' [35913], ssh-connection '', client-mode 'cli'
May 27 10:02:19  left mgd[35913]: UI_CMDLINE_READ_LINE: User 'root', command 'xml-mode '
May 27 10:02:19  left mgd[35913]: UI_LOGOUT_EVENT: User 'root' logout
May 27 10:02:19  left file[35912]: UI_AUTH_EVENT: Authenticated user 'root' at permission level 'super-user'
May 27 10:02:19  left file[35912]: UI_LOGIN_EVENT: User 'root' login, class 'super-user' [35912], ssh-connection '', client-mode 'junoscript'
May 27 10:02:19  left file[35912]: UI_CMDLINE_READ_LINE: User 'root', command 'rpc command clear bgp neighbor 3.3.3.3 '
May 27 10:02:19  left file[35912]: UI_JUNOSCRIPT_CMD: User 'root' used JUNOScript client to run command 'clear-bgp-neighbor neighbor=3.3.3.3'
May 27 10:02:19  left file[35912]: UI_LOGOUT_EVENT: User 'root' logout
出现clear-bgp-neighbor neighbor=3.3.3.3字眼,表示能快速清除bgp邻居会话,不会等待bgp hold time 90秒的超时

在左侧left路由器上观察日志:

root@left# run show log daemon-info.log | last 20
May 27 10:15:33  left rmopd[2311]: PING_PROBE_FAILED: pingCtlOwnerIndex = bgp-mon, pingCtlTestName = icmp-test
May 27 10:15:33  left rpd[2305]: noblock_funopen: task MGMT.local socket 59 bgp_peer_mgmt_clear:6997: NOTIFICATION sent to 3.3.3.3 (Internal AS 65001): code 6 (Cease) subcode 4 (Administratively Reset), Reason: Management session cleared BGP neighbor

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值