This command enables BGP and identifies the autonomous system (AS) number of the router. Only a single instance of BGP can be run and the router can only belong to a single AS.
Default: BGP is inactive by default.
Format: router bgp as-number
Mode: Global Config
as-number: The router’s autonomous system number (ASN).
no router bgp
If you invoke no router bgp, BGP is disabled and all BGP configuration reverts to default values. Alternatively, you can use "no enable (BGP)" on page 680 in Router BGP Configuration mode to disable BGP globally without clearing the BGP configuration.
Default: BGP is inactive by default.
Format: no router bgp as-number
Mode: Global Config
aggregate-address
To configure a summary address for BGP, use the aggregate-address command in Router Configuration mode. No aggregate addresses are configured by default. Unless the options are specified, the aggregate is advertised with the ATOMIC_AGGREGATE attribute and an empty AS path, and the more specific routes are advertised along with the aggregate.
To be considered a match for an aggregate address, a prefix must be more specific (i.e. have a longer prefix length) than the aggregate address. A prefix whose prefix length equals the length of the aggregate address is not considered a match.
When BGP originates a summary address, it installs a reject route in the common routing table for the summary prefix. Any received packets that match the summary prefix, but not a more specific route, match the reject route and are dropped. BGP accepts up to 128 summary addresses.
address mask: Summary prefix and mask. The default route (0.0.0.0 0.0.0.0) cannot be configured as an aggregate-address. The mask cannot be a 32-bit mask (255.255.255.255). The combination of prefix and mask must be a valid unicast destination prefix.
as-set: (Optional) Normally, the aggregate is advertised with an empty AS path and the ATOMIC_AGGREGATE attribute. When the as-set option is given, the aggregate is advertised with an AS_SET containing the set of ASs from which the aggregate was formed.
summary-only: (Optional) When the summary-only option is given, the more-specific routes within the aggregate address are not advertised to neighbors.
no aggregate-address
Use this command to delete a summary address for BGP. The address mask is a summary prefix and mask.
Format: no aggregate-address address mask
Mode: Router BGP Config
bgp aggregate-different-meds
Use the bgp aggregate-different meds command in Router BGP Configuration mode to allow the aggregation of routes with different MED attributes. By default, BGP only aggregates routes that have the same MED value, as prescribed by RFC 4271.
When this command is given, the path for an active aggregate address is advertised without a MED attribute. When this command is not given, if multiple routes match an aggregate address, but have different MEDs, the aggregate takes the MED of the first matching route. Any other matching prefix with the same MED is included in the aggregate. Matching prefixes with different MEDs are not considered to be part of the aggregate and continue to be advertised as individual routes.
Default: All the routes aggregated by a given aggregate address must have the same MED value.
Format: bgp aggregate-different-meds
Mode: Router BGP Config
no bgp aggregate-different-meds
Use the no bgp aggregate-different meds command in Router BGP Configuration mode to return the command to the default.
Format: no bgp aggregate-different-meds
Mode: Router BGP Config
bgp default local-preference
Use this command to specify the default local preference. Local preference is an attribute sent to internal peers to indicate the degree of preference for a route. A route with a numerically higher local preference value is preferred.
BGP assigns the default local preference to each path received from an external peer. (BGP retains the LOCAL_PREF on paths received from internal peers.) BGP also assigns the default local preference to locally- originated paths. If you change the default local preference, the local preference on paths previously received is not changed; it is only applied to paths received after the change. To apply the new local preference to paths previously received, use the command "clear ip bgp" on page 692 to force a soft inbound reset.
Default: If this command is not given, BGP advertises a local preference of 100 in Update messages to internal peers.
Format: bgp default local-preference number
Mode: Router BGP Config
number: The value to use as the local preference for routes advertised to internal peers. The range is 0 to 4,294,967,295.
no bgp default local-preference.
This command sets the default value of local preference of the BGP router.
Format: no bgp default local-preference
Mode: Router BGP Config
bgp fast-external-failover
Use this command to configure BGP to immediately reset the adjacency with an external peer if the routing interface to the peer goes down. When BGP gets a routing interface down event, BGP drops the adjacency with all external peers whose IPv4 address is in one of the subnets on the failed interface. This behavior can be overridden for specific interfaces using the command "ip bgp fast-external-failover.
Default: Fast external failover is enabled by default.
Format: bgp fast-external-failover
Mode: Router BGP Config
no bgp fast-external-failover
Use this command to disable BGP fast-external-failover.
Format: no bgp fast-external-failover
Mode: Router BGP Config
bgp fast-internal-failover
Use this command to configure BGP to immediately reset the adjacency with an internal peer when there is a loss of reachability to an internal peer. BGP tracks the reachability of each internal peer’s IP address. If a peer becomes unreachable (that is, the RIB no longer has a non-default route to the peer’s IP address), then BGP drops the adjacency.
Default: Fast internal failover is enabled by default.
Format: bgp fast-internal-failover
Mode: Router BGP Config
no bgp fast-internal-failover
Use this command to return the "bgp fast-internal-failover" command to the default.
Format: no bgp fast-internal-failover
Mode: Router BGP Config
bgp log-neighbor-changes
Use this command to enable logging of adjacency state changes. Both backward and forward adjacency state changes are logged. Forward state changes, except for transitions to the Established state, are logged at the Informational severity level. Backward state changes and forward changes to Established are logged at the Notice severity level.
Default: Neighbor state changes are not logged by default.
Format: bgp log-neighbor-changes
Mode: Router BGP Config
no bgp log-neighbor-changes
Use this command to return the "bgp log-neighbor-changes" command to the default.
Format: no bgp log-neighbor-changes
Mode: Router BGP Config
bgp router-id
Use this command to set the BGP router ID. There is no default BGP router ID. The system does not select a router ID automatically. You must configure one manually. The BGP router ID must be a valid IPv4 unicast address, but is not required to be an address assigned to the router. The router ID is specified in the dotted notation of an IP address. Setting the router ID to 0.0.0.0 disables BGP. Changing the router ID disables and re-enables BGP, causing all adjacencies to be re-established.
Default: 0.0.0.0
Format: bgp router-id router-id
Mode: Router BGP Config
router-id: An IPv4 address for BGP to use as its router ID.
no bgp router-id
Use this command to reset the BGP router ID, disabling BGP.
Format: no bgp router-id router-id
Mode: Router BGP Config
default-information originate (BGP)
Use this command to allow BGP to originate a default route. By default, BGP does not originate a default route. If a default route is redistributed into BGP, BGP does not advertise the default route unless the default-information originate command has been given. The always option is disabled by default.
Default: BGP does not originate a default route. The always option is disabled by default.
Format: default-information originate [always]
Mode: Router BGP Config
always: (Optional) This optional keyword allows BGP to originate a default route, even if the common routing table has no default route.
no default-information originate
Use this command to disable BGP from originating a default route.
Format: no default-information originate
Mode: Router BGP Config
default metric (BGP)
Use this command to set the value of the Multi Exit Discriminator (MED) attribute on routes redistributed into BGP when no metric has been specified in the command "redistribute (BGP)" on page 691.
Default: No default metric is set and no MED is included in redistributed routes.
Format: default-metric value
Mode: Router BGP Config
value: The value to set as the MED. The range is 1 to 4,294,967,295.
no default metric (BGP)
Use this command to delete the default for the metric of redistributed routes.
Format: no default-metric
Mode: Router BGP Config
distance (BGP)
Use this command to set the preference (also known as administrative distance) of BGP routes to specific destinations. You may enter up to 128 instances of this command. Two instances of this command may not have the same prefix and wildcard mask. If a distance command is configured that matches an existing distance command’s prefix and wildcard mask, the new command replaces the existing command. There can be overlap between the prefix and mask configured for different commands. When there is overlap, the command whose prefix and wildcard mask are the longest match for a neighbor’s address is applied to routes from that neighbor.
An ECMP route’s distance is determined by applying distance commands to the neighbor that provided the best path. The distance command is not applied to existing routes. To apply configuration changes to the distance command itself or the prefix list to which a distance command applies, you must force a hard reset of affected neighbors.
Default: BGP assigns preference values according to the distance bgp command, unless overridden for specific neighbors or prefixes by this command.
distance: The preference value for matching routes. The range is 1 to 255.
prefix wildcard-mask: [Optional] Routes learned from BGP peers whose address falls within this prefix are assigned the configured distance value. The wildcard-mask is an inverted network mask whose 1 bits indicate the don’t care portion of the prefix.
prefix-list: [Optional] A prefix list can optionally be specified to limit the distance value to a specific set of destination prefixes learned from matching neighbors.
no distance (BGP)
Use this command to set the preference of BGP routes to the default.
Format: no distance distance [prefix wildcard-mask [prefix-list]]
Mode: Router BGP Config
distance BGP
Use this command to set the preference, (also known as administrative distance), of BGP routes. Different distance values can be configured for routes learned from external peers, routes learned from internal peers, and BGP routes locally originated. A route with a lower preference value is preferred to a route with a higher preference value to the same destination. Routes with a preference of 255 may not be selected as best routes and used for forwarding.
The change to the default BGP distances does not affect existing routes. To apply a distance change to existing routes, you must force the routes to be deleted from the RIB and relearned, either by resetting the peers from which the routes are learned or by disabling and re-enabling BGP.
external-distance: The preference value for routes learned from external peers. The range is 1 to 255.
internal-distance: The preference value for routes learned from internal peers. The range is 1 to 255.
local-distance: The preference value for locally-originated routes. The range is 1 to 255.
no distance BGP
Use this command to set the default route preference value of BGP routes in the router.
Format: no distance bgp
Mode: Router BGP Config
distribute-list in
Use this command to configure a filter that restricts the routes that BGP accepts from all neighbors based on destination prefix. The distribute list is applied to all routes received from all neighbors. Only routes permitted by the prefix list are accepted. If the command refers to a prefix list that does not exist, the command is accepted and all routes are permitted.
Default: No distribute lists are defined by default.
Format: distribute-list prefix list-name in
Mode: Router BGP Config
prefix list-name: A prefix list used to filter routes received from all peers based on destination prefix.
no distribute-list in
Use this command to disable a filter that restricts the routes that BGP accepts from all neighbors based on destination prefix.
Format: no distribute-list prefix list-name in
Mode: Router BGP Config
distribute-list out (BGP)
Use this command to configure a filter that restricts the advertisement of routes based on destination prefix. Only one instance of this command may be defined for each route source (RIP, OSPF, static, connected). One instance of this command may also be configured as a global filter for outbound prefixes. If the command refers to a prefix list that does not exist, the command is accepted and all routes are permitted.
When a distribute list is added, changed, or deleted for route redistribution, BGP automatically reconsiders all best routes.
Default: No distribute lists are defined by default.
prefix list-name: A prefix list used to filter routes advertised to neighbors.
protocol|connected|static: (Optional) When a route source is specified, the distribute list applies to routes redistributed from that source. Only routes that pass the distribute list are redistributed. The protocol value may be either rip or ospf.
no distribute-list out (BGP)
Use this command to reset the distribute-list out (BGP) command to the default.
Format: no distribute-list prefix list-name out [ protocol | connected | static ]
Mode: Router BGP Config
enable (BGP)
This command globally enables BGP, while retaining the configuration. BGP is enabled by default once you specify the local AS number with the "router bgp" command and configure a router ID with the "bgp router-id" command. When you disable BGP, BGP retains its configuration. If you invoke the "no router bgp" command, all BGP configuration is reset to the default values.
When BGP is administratively disabled, BGP sends a Notification message to each peer with a Cease error code.
Format: enable
Mode: Router BGP Config
no enable (BGP)
This command globally disables the administrative mode of BGP on the system, while retaining the configuration.
Format: no enable
Mode: Router BGP Config
ip bgp fast-external-failover
This command configures fast external failover behavior for a specific routing interface. This command overrides for a specific routing interface the fast external failover behavior configured globally. If permit is specified, the feature is enabled on the interface, regardless of the global configuration. If deny is specified, the feature is disabled on the interface, regardless of the global configuration.
Default: Fast external failover is enabled globally by default. There is no interface configuration by default.
Format: ip bgp fast-external-failover { permit | deny }
Mode: Interface Config
permit: This keyword enables fast external failover on the interface, regardless of the global configuration of the feature.
deny: This keyword disables fast external failover on the interface, regardless of the global configuration of the feature.
no ip bgp fast-external-failover
This command unconfigures the feature on the interface, and the interface uses the global setting.
Format: no ip bgp fast-external-failover
Mode: Interface Config
maximum-paths (BGP)
Use this command to specify the maximum number of next hops BGP may include in an Equal Cost Multipath (ECMP) route derived from paths received from neighbors outside the local autonomous system. Paths are considered for ECMP when their attributes are the same (local preference, AS path, origin, MED, and distance) and the paths are received from different routers. When BGP uses multiple paths in an ECMP route, BGP still selects one path as the best path and advertises only that path to its peers.
Default: BGP uses a single next hop by default
Format: maximum-paths number-of-paths
Mode: Router BGP Config
number-of-paths: The maximum number of next hops in a BGP route. The range is from 1 to 32 unless the platform or SDM template further restricts the range.
no maximum-paths (BGP)
This command resets back to the default the number of next hops BGP may include in an ECMP route.
Format: no maximum-paths
Mode: Router BGP Config
maximum-paths igbp
Use this command to specify the maximum number of next hops BGP may include in an Equal Cost Multipath (ECMP) route derived from paths received from neighbors within the local autonomous system. Paths are considered for ECMP when their attributes are the same (local preference, AS path, origin, MED, and IGP distance) and the paths are advertised from different routers. When BGP uses multiple paths in an ECMP route, BGP still selects one path as the best path and advertises only that path to its peers.
Default: BGP uses a single next hop by default.
Format: maximum-paths igbp number-of-paths
Mode: Router BGP Config
number-of-paths: The maximum number of next hops in a BGP router. The range is from 1 to 32 unless the platform or SDM template further restricts the range.
no maximum-paths igbp
Use this command to reset back to the default the number of next hops BGP may include in an ECMP route derived from paths received from neighbors within the local autonomous system.
Format: no maximum-paths igbp
Mode: Router BGP Config
neighbor advertisement-interval
Use this command to configure the minimum time that must elapse between advertisements of the same route to a given neighbor. RFC 4271 recommends the interval for internal peers be shorter than the interval for external peers to enable fast convergence within an autonomous system. This value does not limit the rate of route selection, only the rate of route advertisement. If BGP changes the route to a destination multiple times while waiting for the advertisement interval to expire, only the final result is advertised to the neighbor. BGP enforces the advertisement interval by limiting how often phase 3 of the decision process can run for each update group. The interval applies to withdrawals as well as active advertisements.
seconds: The minimum time between route advertisement, in seconds. The range is 0 to 600 seconds.
no neighbor advertisement-interval
Use this command to return to the default the minimum time that must elapse between advertisements of the same route to a given neighbor.
Format: no neighbor ip-address advertisement-interval
Mode: Router BGP Config
neighbor connect-retry-interval
This command configures the initial connection retry time for a specific neighbor. If a neighbor does not respond to an initial TCP connection attempt, the software retries three times. The first retry is after the retry interval configured with neighbor connect-retry-interval. Each subsequent retry doubles the previous retry interval. So by default, the TCP connection is retried after 2, 4, and 8 seconds. If none of the retries is successful, the adjacency is reset to the IDLE state and the IDLE hold timer is started. BGP skips the retries and transitions to IDLE state if TCP returns an error, such a destination unreachable, on a connection attempt.
retry-time: The number of seconds to wait before attempting to establish a TCP connection with a neighbor after a previous attempt failed.
no neighbor connect-retry-interval
This command resets to the default the initial connection retry time for a specific neighbor.
Format: no neighbor ip-address connect-retry-interval retry-time
Mode: Router BGP Config
neighbor default-originate
To configure BGP to originate a default route to a specific neighbor, use the neighbor default-originate command in BGP router configuration mode. A neighbor-specific default has no MED and the Origin is IGP. A neighbor-specific default is only advertised if the Adj-RIB-Out does not include a default learned by other means, either from the "default-information originate (BGP)" command or a default learned from a peer. This type of default origination is not conditioned on the presence of a default route in the routing table. This form of default origination does not install a default route in the BGP routing table (it will not appear in the "show ip bgp"command), nor does it install a default route in the Adj-RIB-Out for the update group of peers so configured (it will not appear in the "show ip bgp neighbors advertised-routes" command).
Origination of the default route is not subject to a prefix filter configured with the command "distribute-list out (BGP)".
Default: No default is originated by default.
Format: neighbor ip-address default-originate
Mode: Router BGP Config
ip-address: The neighbor’s IP address.
no neighbor default-originate
Use this command to prevent BGP from originating a default route to a specific neighbor.
Format: no neighbor ip-address default-originate
Mode: Router BGP Config
neighbor description
Use this command to record a text description of a neighbor. The description is informational and has no functional impact.
Default: No description is originated by default.
Format: neighbor ip-address description text
Mode: Router BGP Config
ip-address: The neighbor’s IP address.
text: Text description of neighbor. Up to 80 characters are allowed.
no neighbor description
Use this command to delete the text description of a neighbor.
Format: no neighbor ip-address description
Mode: Router BGP Config
neighbor filter-list
This command filters advertisements to or from a specific neighbor according to the advertisement’s AS Path. Only a single AS path list can be configured in each direction for each neighbor. If you invoke the command a second time for a given neighbor, the new AS path list number replaces the previous AS path list number. If you assign a neighbor filter list to a non-existent AS path access list, all routes are filtered.
Default: No neighbor filter lists are configured by default.
in: The AS Path list is applied to advertisements received from the neighbor.
out: The AS Path list is applied to advertisements to be sent to the neighbor.
no neighbor filter-list
Use this command to unconfigure neighbor filter lists.
Format: no neighbor ip-address filter-list as-path-list-number {in | out}
Mode: Router BGP Config
neighbor maximum-prefix
This command configures the maximum number of prefixes that BGP will accept from a specified neighbor. If the peering session is shut down, the adjacency stays down until the "clear ip bgp" command is issued for the neighbor.
Default: By default the prefix limit is set to the maximum number of routes that can be installed in the forwarding table. The default warning threshold is 75%. A neighbor that exceeds the limit is shutdown unless the warning-only option is configured.
maximum: The maximum number of prefixes BGP will accept from this neighbor. Range is 0 to the maximum number of routes the router supports.
unlimited: Do not enforce any prefix limit.
threshold: (Optional) When the number of prefixes received from the neighbor exceeds this percentage of the maximum, BGP writes a log message. The range is 1 to 100 percent. The default is 75 %.
warning-only: (Optional) If BGP receives more than the maximum number of prefixes, BGP discards excess prefixes and writes a log message rather than shutting down the adjacency.
no neighbor maximum-prefix
This command reverts to the default value for the maximum the number of prefixes that BGP will accept from a specified neighbor.
Format: no neighbor ip-address maximum-prefix
Mode: Router BGP Config
neighbor next-hop-self
This command configures BGP to set the next hop attribute to a local IP address when advertising a route to an internal peer. Normally, BGP would retain the next hop attribute received from the external peer. When the next hop attribute in routes from external peers is retained, internal peers must have a route to the external peer’s IP address. This is commonly done by configuring the IGP on the border router to advertise the external (or DMZ) subnet. The next-hop-self option eliminates the need to advertise the external subnet in the IGP.
Default: not enabled
Format: neighbor ip-address next-hop-self
Mode: Router BGP Config
ip-address: The neighbor’s IP address.
no neighbor next-hop-self
This command disables the peer as the next hop for the locally originated paths. After executing this command, the BGP peer must be reset before the changes take effect.
Format: no neighbor ip-address next-hop-self
Mode: Router BGP Config
neighbor password
This command enables MD5 authentication of TCP segments sent to and received from a neighbor, and configures an authentication key. MD5 must either be enabled or disabled on both peers. The same password must be configured on both peers. After a TCP connection is established, if the password on one end is changed, then the password on the other end must be changed to match before the hold time expires. With default hold times, both passwords must be changed within 120 seconds to guarantee the connection is not dropped
Default: MD5 authentication is disabled.
Format: neighbor ip-address password string
Mode: Router BGP Config
ip-address: The neighbor’s IP address.
string: Case-sensitive password from 1 to 25 characters in length.
no neighbor password
This command disables MD5 authentication of TCP segments sent to and received from a neighbor.
Format: no neighbor ip-address password
Mode: Router BGP Config
neighbor prefix-list
This command filters advertisements sent to a specific neighbor based on the destination prefix of each route. Only one prefix list may be defined for each neighbor in each direction. If you assign a prefix list that does not exist, all prefixes are permitted.
Default: No prefix list is configured.
Format: neighbor ip-address prefix-list prefix-list-name { in | out }
Mode: Router BGP Config
ip-address: The neighbor’s IP address.
prefix-list-name: The name of an IP prefix list.
in: Apply the prefix list to advertisements received from this neighbor.
out: Apply the prefix list to advertisements to be sent to this neighbor.
no neighbor prefix-list
This command disables filtering advertisements sent to a specific neighbor based on the destination prefix of each route.
Format: no neighbor ip-address prefix-list prefix-list-name { in | out }
Mode: Router BGP Config
neighbor remote-as
This command configures a neighbor and identifies the neighbor’s autonomous system. Up to 100 neighbors may be configured.
Default: No neighbors are configured by default.
Format: neighbor ip-address remote-as
Mode: Router BGP Config
ip-address: The neighbor’s IP address.
remote-as as-number: The autonomous system number of the neighbor’s AS. The range is 1 to 65,535. If the neighbor’s AS number is the same as the local router, the peer is an internal peer. Otherwise, the peer is an external peer.
no neighbor remote-as
This command un-configures neighbors.
Format: no neighbor ip-address {remote-as}
Mode: Router BGP Config
neighbor shutdown
This command brings down an the adjacency with a specific neighbor. If the adjacency is up when the command is given, the peering session is dropped and all route information learned from the neighbor is purged.
When a neighbor is shut down, BGP first sends a NOTIFICATION message with a Cease error code. When an adjacency is administratively shut down, the adjacency stays down until administratively re-enabled (using the command "no neighbor shutdown" below).
Default: Neighbors are not shutdown by default.
Format: neighbor ip-address shutdown
Mode: Router BGP Config
ip-address: The neighbor’s IP address. This is the IP address on the link that connects the two peers.
no neighbor shutdown
This command administratively enables a BGP peer.
Format: no neighbor ip-address shutdown
Mode: Router BGP Config
neighbor timers
This command overrides the global timer values and sets the keepalive and hold timers for a specific neighbor. The new values are not applied to adjacencies already in the ESTABLISHED state. A new keepalive or hold time is applied the next time an adjacency is formed.
Default: The keep alive and hold timers default to the globally configured values set with the "timers bgp" command.
ip-address: The neighbor’s IP address. This is the IP address on the link that connects the two peers.
keepalive: The time, in seconds, between BGP KEEPALIVE packets sent to a neighbor. The range is 0 to 65,535 seconds. Jitter is applied to the keepalive interval.
holdtime: The time, in seconds, that BGP continues to consider a neighbor to be alive without receiving a BGP KEEPALIVE or UPDATE packet from the neighbor. If no KEEPALIVE is received from a neighbor for longer than the hold time, BGP drops the adjacency. If the hold time is set to 0, then BGP does not enforce a hold time and BGP does not send periodic KEEPALIVE messages. The range is 0 to 65,535 seconds.
no neighbor timers
This command reverts the keep alive and hold time for a peer to their defaults. After executing this command, the BGP peer must be reset before the changes will take effect.
Format: no neighbor ip-address timers
Mode: Router BGP Config
neighbor update-source
This command configures BGP to use a specific IP address as the source address for the TCP connection with a neighbor. This IP address must be the IP address configured on the peer as its neighbor address for this router. The IP address used as the source address in IP packets sent to a neighbor must be the same address used to configure the local system as a neighbor of the neighbor router. In other words, if the update source is configured, it must be the same IP address used in the neighbor remote-as command on the peer. It is common to use an IP address on a loopback interface because a loopback interface is always reachable, as long as any routing interface is up. The peering session can stay up as long as the loopback interface remains reachable. If you use an IP address on a routing interface, then the peering session will go down if that routing interface goes down.
Default: When no update source is configured, TCP connections use the primary IPv4 address on the outgoing interface to the neighbor.
ip-address: The neighbor’s IP address. This is the IP address on the link that connects the two peers.
update-source interface: The primary IPv4 address on this interface is used as the source IP address for the TCP connection with the neighbor.
no neighbor update-source
This command configures BGP to use the primary IPv4 address on the outgoing interface to the neighbor for the TCP connection.
Format: no neighbor ip-address update-source
Mode: Router BGP Config
network (BGP)
This command configures BGP to advertise an address prefix.The prefix is only advertised if the common routing table includes a non-BGP route with the same prefix. The route may be a connected route, a static route, or a dynamic route from another routing protocol. BGP accepts up to 64 networks. The network command may specify a default route (network 0.0.0.0 mask 0.0.0.0).
Default: No networks are advertised by default.
Format: network prefix mask network-mask
Mode: Router BGP Config
prefix: An IPv4 address prefix in dotted notation.
network-mask: The network mask for the prefix in dotted quad notation (e.g., 255.255.0.0).
no network (BGP)
This command disables BGP from advertising an address prefix.
Format: no network prefix mask network-mask
Mode: Router BGP Config
redistribute (BGP)
This command configures BGP to advertise routes learned by means outside of BGP. BGP can redistribute local (connected), static, OSPF, and RIP routes. The distribute-list out command can also be used to filter redistributed routes by prefix. Either a redistribute route map or a distribute list may be configured, but not both. A default route cannot be redistributed unless the "default-information originate (BGP)" command is given.
Default: BGP redistributes no routes by default. When BGP redistributes OSPF routes, it redistributes only internal routes unless the match option specifies external routes.
ospf, rip, connected, static: A source of routes to redistribute.
metric metric-value: (Optional) When this option is specified, BGP advertises the prefix with the Multi Exit Discriminator path attribute set to the configured value. If this option is not specified, but a default metric is configured for BGP ("default metric (BGP)" command), then the MED is set to the default metric. If a default metric is not configured, then the prefix is advertised without a MED attribute.
match: (Optional) If you configure BGP to redistribute OSPF routes, BGP by default only redistributes internal routes (OSPF intra-area and inter-area routes). Use the match option to configure BGP to also redistribute specific types of external routes, or to disable redistribution of internal OSPF routes.
route-map map-tag: (Optional) A route map can be used to filter redistributed routes by destination prefix using a prefix list.
no redistribute (BGP)
This command removes the configuration for the redistribution for BGP protocol from the specified source protocol/routers. The command no redistribute opsf match external 1 will withdraw only OSPF external type 1 routes, ospf inter routes will still be redistributing.
This command configures the keepalive and hold times that BGP uses for all of its neighbors.
When BGP establishes an adjacency, the neighbors agree to use the minimum hold time configured on either neighbor. BGP sends KEEPALIVE messages at either 1/3 of the negotiated hold time or the configured keepalive interval, whichever is more frequent. The new values are not applied to adjacencies already in the ESTABLISHED state. A new keepalive or hold time is applied the next time an adjacency is formed.
Default: The default keepalive time is 30 seconds. The default hold time is 90 seconds.
Format: timers bgp keepalive holdtime
Mode: Router BGP Config
keepalive: The time, in seconds, between BGP KEEPALIVE packets sent to a neighbor. The range is 0 to 65,535 seconds. Jitter is applied to the keepalive time.
holdtime: The time, in seconds, that BGP continues to consider a neighbor to be alive without receiving a BGP KEEPALIVE or UPDATE packet from the neighbor. If no KEEPALIVE is received from a neighbor for longer than the hold time, BGP drops the adjacency. If the hold time is set to 0, then BGP does not enforce a hold time and BGP does not send periodic KEEPALIVE messages. The range is 0 to 65,535 seconds.
no timers bgp
This command sets to the default the keepalive and hold times that BGP uses for all of its neighbors.
Format: no timers bgp
Mode: Router BGP Config
clear ip bgp
This command resets peering sessions with all or a subnet of BGP peers. The command arguments specify which peering sessions are reset and the type of reset performed. Soft inbound reset causes BGP to send a Route Refresh request to each neighbor being reset. If a neighbor does not support the Route Refresh capability, then updated policy is applied to routes previously received from the neighbor. When a change is made to an outbound policy, BGP schedules an outbound soft reset to update neighbors according to the new policy.
as-number: Only reset adjacencies with BGP peers in the given autonomous system
neighbor-address: Only reset the adjacency with a single specified peer
soft: (Optional) By default, adjacencies are torn down and reestablished. If the soft keyword is given, BGP resends all updates to the neighbors and reprocesses updates from the neighbors.
in | out: (Optional) If the in keyword is given, then updates from the neighbor are reprocessed. If the out keyword is given, then updates are resent to the neighbor. If neither keyword is given, then updates are reprocessed in both directions.
clear ip bgp counters
This command resets all BGP counters to 0. These counters include send and receive packet and prefix counters for all neighbors.
Format: clear ip bgp counters
Mode: Privileged EXEC
show ip bgp
To view routes in the BGP routing table, use the show ip bgp command in Privileged EXEC mode. The output lists both best and non-best paths to each destination.
Format: show ip bgp [ network/pfx-len [ longer-prefixes | shorter-prefixes [ length ] ] | filter-list as-path-list ]
Mode: Privileged EXEC
network/pfx-len: (Optional) Display a specific route identified by its destination prefix
longer-prefixes: (Optional) Used with the network/pfx-len option to show routes whose prefix length is equal to or longer than pfx-len. This option may not be given if the shorter-prefixes option is given.
shorter-prefixes [length]: (Optional) Used with the network/pfx-len option to show routes whose prefix length is shorter than pfx-len, and, optionally, longer than a specified length. This option may not be given if the longer-prefixes option is given.
filter-list as-path-list: (Optional) Filter the output to the set of routes that match a given AS Path list. This option may not be given if a network/pfx-len option is given. The command output displays the following information.
BGP table version: Each time phase 2 of the BGP decision process runs to select new BGP routes, this number is incremented.
Status codes:
s – The route is aggregated into an aggregate address configured with the summary- only option
* – BGP never displays invalid routes; so this code is always displayed
> – Indicates that BGP has selected this path as the best path to the destination
i – If the route is learned from an internal peer
Network: Destination prefix
Next Hop: The route’s BGP NEXT HOP
Metric: Multi Exit Discriminator
LocPrf: The local preference
Path: The AS path
Origin: The value of the Origin attribute
show ip bgp aggregate-address
This command lists aggregate addresses that have been configured and indicates whether each is currently active.
Format: show ip bgp aggregate-address
Mode: Privileged EXEC
Prefix/Len: Destination prefix and prefix length
AS Set: Indicates whether an empty AS path is advertised with the aggregate address (N) or an AS SET is advertised with the set of AS numbers for the paths contributing to the aggregate (Y)
Summary Only: Indicates whether the individual networks are suppressed (Y) or advertised (N).
Active: Indicates whether the aggregate is currently being advertised.
show ip bgp neighbors
This command shows details about BGP neighbor configuration and status.
Format: show ip bgp neighbors [neighbor-address]
Mode: Privileged EXEC
neighbor-address: [Optional] The IP address of a neighbor. Used to limit the output to show a single neighbor.
The command output displays the following information.
Remote Address: The neighbor’s IP address
Remote AS: The neighbor’s autonomous system number
Peer ID: The neighbor’s BGP router ID
Peer Admin Status: START or STOP
Peer State: The adjacency state of this neighbor
Local Port: TCP port number on the local end of the connection
Remote Port: TCP port number on the remote end of the connection
Connection Retry Interval: How long BGP waits between connection retries
Neighbor Capabilities: Optional capabilities reported by the neighbor, recognized and accepted by this router. This version of software does not support any multiprotocol AFI/SAFI pairs other than IPv4 unicast. The presence of this capability does not imply otherwise.Codes listed in the show output are as follows:
MP: Multiprotocol
RF: Route Refresh
Next Hop Self: Whether the local router is configured to advertise one of its own IP addresses as the BGP Next Hop when advertising a path learned from an external peer
Update Source: The configured value for the source IP address of packets sent to this peer. This field is only included in the output if the update source is configured.
Local Interface Address: The IPv4 address used as the source IP address in packets sent to this neighbor.
Configured Hold Time: The time, in seconds, that this router proposes to this neighbor as the hold time
Configured Keep Alive Time: The configured KEEPALIVE interval for this neighbor.
Negotiated Hold Time: The minimum of the configured hold time and the hold time in the OPEN message received from this neighbor. If the local router does not receive a KEEPALIVE or UPDATE message from this neighbor within this interval of time, the local router drops the adjacency. This field is only shown if the adjacency state is OPEN CONFIRM or greater.
Keep Alive Time: The number of seconds between KEEPALIVE messages sent to this neighbor. This field is only shown if the adjacency state is OPEN CONFIRM or greater.
Prefix Limit: The maximum number of prefixes this router is willing to accept from this neighbor
Prefix Warning Threshold: Percentage of the prefix limit that causes a warning message to be logged
Warning Only on Prefix Limit: Whether to shutdown a neighbor that exceeds the prefix limit. TRUE if the event is logged without shutting down the neighbor
Minimum Advertisement Interval: The minimum time between UPDATE messages sent to this neighbor
MD5 Password: The TCP MD5 password, if one is configured, in plain text
Last Error: The last error that occurred on the connection to this neighbor
Last SubError: The suberror reported with the last error.
Established Transitions: The number of times the adjacency has transitioned into the Established state
Established Time: How long since the connection last transitioned to or from the Established state
Time Elapsed Since Last Update: How long since an UPDATE message has been received from this neighbor
Message Table: The number of BGP messages sent to and received from this neighbor
Prefixes Advertised: A running count of the number of prefixes advertised to or received from this neighbor
Prefixes Withdrawn: A running count of the number of prefixes included in the Withdrawn Routes portion of UPDATE messages, to and from this neighbor
Prefixes Current: The number of prefixes currently advertised to or received from this neighbor
Max NLRI per Update: The maximum number of prefixes included in a single UPDATE message, to and from this neighbor
Min NLRI per Update: The minimum number of prefixes included in a single UPDATE message, to and from this neighbor
If the router receives an UPDATE message with an invalid path attribute, the router will in most cases send a NOTIFICATION message and reset the adjacency. BGP maintains a per-neighbor counter for each type of path attribute error. This show command lists each non-zero counter, just after the LastSubError. The counters that may be listed are as follows:
Path with duplicate attribute: The peer sent an UPDATE message containing the same path attribute more than once.
Path with well-known/optional conflict: A received path attribute was flagged as both well-known and optional or neither well-known nor optional.
Transitive flag not set on transitive attr: A received path attribute is known to be transitive, but the transitive flag is not set.
Mandatory attribute non-transitive or partial: A mandatory path attribute was received with either the transitive or partial flag set.
Optional attribute non-transitive and partial: An optional path attribute has the transitive flag clear and the partial flag set.
Path attribute too long: A received path attribute was longer than the expected length.
Path attribute length error: A received path attribute has a length value that exceeds the remaining length of the path attributes field.
Invalid ORIGIN code: A received UPDATE message included an invalid ORIGIN code.
Unexpected first ASN in AS path: The AS Path attribute from an external peer did not include the peer’s AS number as the first AS.
Invalid AS path segment type: The AS Path includes a segment with an invalid segment type.
Invalid BGP NEXT HOP: The BGP NEXT HOP is not a valid unicast address.
Bad BGP NEXT HOP: The BGP NEXT HOP was either the receiver’s IP address or an IP address outside the subnet to the peer.
Invalid AGGREGATOR attribute: The AGGREGATOR attribute was invalid.
Unrecognized well-known path attribute: An UPDATE message contained a path attribute with the Optional flag clear, but this router does not recognize the attribute.
Missing mandatory path attribute: An UPDATE message was received without a mandatory path attribute.
Missing LOCAL PREF attribute: An UPDATE message was received from an internal peer without the LOCAL PREF attribute.
Invalid prefix in UPDATE NLRI: An UPDATE message received from this peer contained a syntactically incorrect prefix.
show ip bgp neighbors advertised-routes
This command displays the list of routes advertised to a specific neighbor. These are the routes in the adjacent RIB out for the neighbor’s outbound update group.
Format: show ip bgp neighbors ip-address advertised-routes
Mode: Privileged EXEC
ip-address: The IP address of a neighbor.
The command output displays the following information.
BGP table version: Each time phase 2 of the BGP decision process runs to select new BGP routes, this number is incremented
Status codes: The route has been updated in Adj-RIB-Out since the last UPDATE message was sent. Transmission of an UPDATE message is pending.
Network: Destination prefix
Next Hop: The BGP NEXT HOP as advertised to the peer.
Local Pref: The local preference. Local preference is never advertised to external peers.
Metric: The value of the Multi Exit Discriminator, if the MED is advertised to the peer.
Path: The AS path. The AS path does not include the local AS number, which is added to the beginning of the AS path when a route is advertised to an external peer.
Origin: The value of the Origin attribute.
NOTE: This output differs slightly from the output in show ip bgp. Suppressed routes and non-best routes are not advertised, so these status codes are not relevant here. Advertised routes always have a single next hop, the BGP NEXT HOP advertised to the peer. Local preference is never sent to external peers.
The output indicates whether BGP is configured to originate a default route to this peer (neighbor default-originate).
show ip bgp neighbors received-routes
This command displays the list of routes received from a specific neighbor. The list includes both accepted and rejected routes.
Format: show ip bgp neighbors ip-address received-routes
Mode: Privileged EXEC
ip-address: The IP address of a neighbor.
The command output displays the following information.
Network: Destination prefix
Next Hop: The BGP NEXT HOP as advertised by the peer.
Metric: The value of the Multi Exit Discriminator, if a MED is received from the peer.
Local Pref: The local preference received from the peer.
Path: The AS path as received from the peer
Origin: The value of the Origin attribute as received from the peer
show ip bgp statistics
This command displays recent decision process history. Phase 1 of the decision process reacts to UPDATE messages received from peers, determining what new routes are accepted and deleting withdrawn routes from the Adj-RIB-In. Phase 2 determines the best path for each destination, updates the BGP route table, and updates the common RIB. Phase 3 is run independently for each outbound update group and determines which routes should be advertised to neighbors in each group. Each entry in the table shows statistics for one phase of the decision process. The table shows the 20 most recent decision process runs, with the most recent information at the end of the table.
Format: show ip bgp statistics
Mode: Privileged EXEC
The command displays the following information.
Delta T: How long since the decision process was run. hours:minutes:seconds if the elapsed time is less than 24 hours. Otherwise, days:hours.
Phase: Which phase of the decision process was run
Upd Grp: Outbound update group ID. Only applies when phase 3 is run.
GenId: Generation ID of BGP routing table when decision process was run. The generation ID is incremented each time phase 2 of the decision process is run and when there is a change to the status of aggregate addresses.
Reason: The event that triggered the decision process to run
Peer: Phase 1 of the decision process can be triggered for a specific peer when a peer’s inbound routing policy changes or the peer is reset. When phase 1 is run for a single peer, the peer’s IP address is given.
Duration: How long the decision process took, in milliseconds
Adds: The number of routes added. For phase 1, this is the number of prefixes that pass inbound policy and are added to the Accept-RIB-In. For phase 2, this is the number of routes added to the BGP routing table. For phase 3, this is the number of prefixes added to the update group’s Adj-RIB-Out.
Mods: The number of routes modified. Always 0 for phase 1.
Dels: The number of routes deleted. Always 0 for phase 1.
show ip bgp summary
This command displays a summary of BGP configuration and status.
Format: show ip bgp summary
Mode: Privileged EXEC
The command displays the following information.
Admin Mode: Whether BGP is globally enabled
BGP Router ID: The configured router ID
Local AS Number: The router’s AS number
Traps: Whether BGP traps are enabled.
Maximum Paths: The maximum number of next hops in an external BGP route.
Maximum Paths iBGP: The maximum number of next hops in an internal BGP route.
Default Keep Alive Time: The configured keepalive time used by all peers that have not been configured with a peer-specific keepalive time.
Default Hold Time: The configured hold time used by all peers that have not been configured with a peer-specific hold time.
Number of Network Entries: The number of distrinct prefixes in the local RIB
Number of AS Paths: The number of AS paths in the local RIB
Default Metric: The default value for the MED for redistributed routes.
Default Route Advertise: Whether BGP is configured to advertise a default route. Corresponds to the "default-information originate (BGP)" command.
Redistributing Source: A source of routes that BGP is configured to redistribute.
Metric: The metric configured with the redistribute command.
Match Value: For routes redistributed from OSPF, the types of OSPF routes being redistributed.
Distribute List: The name of the prefix list used to filter redistributed routes, if one is configured with the "distribute-list out (BGP)" command.
Route Map: The name of the route map used to filter redistributed routes.
Neighbor: The IP address of a neighbor
ASN: The neighbor’s ASN
MsgRcvd: The number of BGP messages received from this neighbor
MsgSent: The number of BGP messages sent to this neighbor
State: The adjacency state. One of IDLE, CONNECT, ACTIVE, OPEN SENT, OPEN CNFRM, EST
Up/Down Time: How long the adjacency has been in the ESTABLISHED state, or, if the adjacency is down, how long it has been down. In days:hours:minutes:seconds
Pfx Rcvd: The number of prefixes received from the neighbor
show ip bgp update-group
This command reports the status of outbound update groups and their members.
Format: show ip bgp update-group [group-index | peer-address ]
Mode: Privileged EXEC
group-index: (Optional) If specified, this option restricts the output to a single update group.
peer-address: (Optional) If specified, this option restricts the output to the update group containing the peer with the given address.
The command displays the following information.
Update Group ID: Unique identifier for outbound update group
Peer Type: Whether peers in this update group are internal or external
Minimum Advertisement Interval: The minimum time, in seconds, between sets of UPDATE messages sent to the group
Neighbor AS Path Access List Out: The AS path access list used to filter UPDATE messages sent to peers in the update group
Neighbor Prefix List Out: Name of the prefix list used to filter prefixes advertised to the peers in the update group
Members Added: The number of peers added to the group since the group was formed
Members Removed: The number of peers removed from the group
Update Version: The number of times phase 3 of the BGP decision process has run for this group to determine which routes should be advertised to the group
Number of UPDATEs Sent: The number of UPDATE messages that have been sent to this group. Incremented once for each UPDATE regardless of the number of group members
Time Since Last UPDATE: Time since an UPDATE message was last sent to the group. If no UPDATE has been sent to the group, the status is "Never."
Current Prefixes: The number of prefixes currently advertised to the group
Current Paths: The number of paths currently advertised to the group
Prefixes Advertised: The total number of prefixes advertised to the group since the group was formed
Prefixes Withdrawn: The total number of prefixes included in the Withdrawn Routes field of UPDATE messages sent to the group since the group was formed
UPDATE Send Failures: The number of UPDATE messages that failed to be delivered to all members of the group
Current Members: The IPv4 address of all current members of the group
The update send history table show statistics on as many as the ten most recent executions of the update send process for the update group. Items in the history table are as follows:
Version: The update version
Delta T: The amount of time elapsed since the update send process executed - hours::minutes::seconds.
Duration: How long the update send process took, in milliseconds
UPD Built: The number of UPDATE messages built
UPD Sent: The number of UPDATE messages successfully transmitted to group members. Normally a copy of each UPDATE message built is sent to each group member.
Paths Sent: The number of paths advertised
Pfxs Adv: The number of prefixes advertised
Pfxs Wd: The number of prefixes withdrawn
debug ip bgp
To enable debug tracing of BGP events, use the debug ip bgp command in privileged EXEC mode. Debug messages are sent to the system log at the DEBUG severity level. To print them on the console, enable console logging at the DEBUG level (logging console debug command) - see "logging console" on page 192. The debug options enabled for a specific peer are the union of the options enabled globally and the options enabled specifically for the peer.
Enabling one of the packet type options enables packet tracing in both the inbound and outbound directions.
Default: No debug tracing is enabled by default
Format: debug ip bgp [ peer-address | events | keepalives | notification | open | refresh | updates ]
Mode: Privileged EXEC
peer-address: (Optional) The IPv4 address of a BGP peer. Debug traces are enabled for a specific peer when this option is specified. The command can be issued multiple times to enable simultaneous tracing for multiple peers.
events: (Optional) Trace adjacency state events.
keepalives: (Optional) Trace transmit and receive of KEEPALIVE packets.
notification: (Optional) Trace transmit and receive of NOTIFICATION packets.
open: (Optional) Trace transmit and receive of OPEN packets.
refresh: (Optional) Traces transmit and receive of ROUTE REFRESH packets.
updates: (Optional) Traces transmit and receive of UPDATE packets.
snapshot bgp
Use the snapshot bgp command in Support mode to dump a set of BGP debug information to capture the current state of BGP.