clear bgp

To clear Border Gateway Protocol (BGP) routes from the BGP table, use the clear bgp command.

clear bgp {ipv4 {multicast | unicast} | all} {neighbor | * | as-number | peer-template name | prefix} [vrf vrf-name]

Syntax Description

ipv4

Clears the BGP information for the IPv4 address family.

multicast

Clears BGP information for the multicast address family.

unicast

Clears BGP information for the unicast address family.

all

Clears the BGP information for all address families.

neighbor

Network address. The format is A.B.C.D for IPv4.

*

Clears all neighbors.

as-number

Autonomous system number. The range is from 1 to 65535.

peer-template name

Specifies a BGP peer template. The name can be any case-sensitive, alphanumeric string up to 63 characters.

prefix

Prefix from the selected address family. The format is A.B.C.D/length for IPv4.

vrf vrf-name

(Optional) Specifies a particular virtual routing and forwarding (VRF) context name or all VRF instances. The VRF name can be any case-sensitive, alphanumeric string up to 32 characters.


Command Default

None

Command Modes

Any command mode

Command History

Release
Modification

5.0(3)N1(1)

This command was introduced.


Usage Guidelines

This command requires the LAN Enterprise Services license.

Examples

This example shows how to clear all BGP entries:

switch# clear bgp all *