Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

clear bgp neighbor

date_range 16-May-24

Syntax

content_copy zoom_out_map
clear bgp neighbor 
<all>
<as as-number>
<gracefully>
<instance instance-name>
<logical-system (all | logical-system-name)>
<malformed-route>
<neighbor>
<soft | soft-inbound>
<soft-minimum-igp>
<soft-reconfig>        
<stale-routes>

Syntax (EX Series Switch and QFX Series)

content_copy zoom_out_map
clear bgp neighbor 
<all>
<as as-number>
<instance instance-name>
<malformed-route>
<neighbor>
<soft | soft-inbound>
<soft-minimum-igp>

Description

Perform one of the following tasks:

  • Change the state of one or more BGP neighbors to IDLE. For neighbors in the ESTABLISHED state, this command drops the TCP connection to the neighbors and then reestablishes the connection.

  • (soft keyword only) Reapply export policies and send refresh updates to one or more BGP neighbors without changing their state.

  • (soft-inbound keyword only) Send a route-refresh message to one or more BGP neighbors without changing their state, and reapply import policies on the received updates.

Options

all

Change the state of all BGP neighbors to IDLE.

as as-number

(Optional) Apply this command only to neighbors in the specified autonomous system (AS).

gracefully

(Optional) Enable the BGP peer to start graceful-restart receiving-speaker mode. The receiving speaker also sends its own routes to the restarted speaker, and sends an End-of-RIB marker when it completes the update. The clear bgp neighbor neighbor-address gracefully command is the same as clear bgp neighbor hard (the default for clear bgp neighbor), but it does not use the new Hard Reset subcode on the Notify and Cease messages that are sent. This allows the neighbor to enter GR or LLGR helper mode, if negotiated. The session is still cleared on this router, and this router does not enter GR or LLGR helper mode.

instance instance-name

(Optional) Apply this command only to neighbors for the specified routing instance.

logical-system (all | logical-system-name)

(Optional) Perform this operation on all logical systems or on a particular logical system.

malformed-route

(Optional) Remove malformed routes. If a specific neighbor is provided, Junos OS removes malformed routes for that particular neighbor. Otherwise, Junos OS removes malformed routes for all BGP neighbors. To find routes that have malformed attributes, run the show route hidden command, and look for routes marked with MalformedAttr in the AS path field.

neighbor

(Optional) IP address of a BGP peer. Apply this command only to the specified neighbor.

soft

(Optional) Reapply any export policies and send refresh updates to neighbors without clearing the state.

soft-inbound

(Optional) Send a route-refresh message to BGP neighbors and reapply import policies on the route updates received from the BGP neighbors without clearing the BGP state.

soft-minimum-igp

(Optional) Provide soft refresh of the outbound state when the interior gateway protocol (IGP) metric is reset.

soft-reconfig (Optional) Trigger the import re-evaluation of a set of BGP neighbors. soft reset inbound state by import re-evaluation.
stale-routes

(Optional) Any stale route currently being held for the specified neighbor because of BGP graceful restart (GR) or long-lived graceful restart (LLGR) receiver mode operations.

Required Privilege Level

clear

Output Fields

When you enter this command, you are provided feedback on the status of your request.

Sample Output

clear bgp neighbor

content_copy zoom_out_map
user@host> clear bgp neighbor 

Release Information

Command introduced before Junos OS Release 7.4.

malformed-route option introduced in Junos OS Release 13.2.

all option introduced in Junos OS Release 14.2.

gracefully and stale-routes options introduced in Junos OS Release 15.1.

footer-navigation