Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols, Release 12.2
BGP Commands: aggregate-address Through neighbor peer-group (assigning members)

Table Of Contents

BGP Commands

aggregate-address

auto-summary (BGP)

bgp always-compare-med

bgp bestpath as-path ignore

bgp bestpath compare-routerid

bgp bestpath med confed

bgp bestpath med missing-as-worst

bgp client-to-client reflection

bgp cluster-id

bgp confederation identifier

bgp confederation peers

bgp dampening

bgp default ipv4-unicast

bgp default local-preference

bgp deterministic-med

bgp fast-external-fallover

bgp log-neighbor-changes

bgp maxas-limit

bgp redistribute-internal

bgp router-id

bgp rr-group

bgp suppress-inactive

clear ip bgp

clear ip bgp dampening

clear ip bgp external

clear ip bgp flap-statistics

clear ip bgp peer-group

clear ip prefix-list

default-information originate (BGP)

default-metric (BGP)

distance bgp

distribute-list in (BGP)

distribute-list out (BGP)

export map

ip as-path access-list

ip bgp-community new-format

ip bgp fast-external-fallover

ip community-list

ip extcommunity-list

ip prefix-list

ip prefix-list description

ip prefix-list sequence-number

match as-path

match community

match extcommunity

maximum-paths

neighbor advertisement-interval

neighbor advertise-map

neighbor default-originate

neighbor description

neighbor distribute-list

neighbor ebgp-multihop

neighbor filter-list

neighbor local-as

neighbor maximum-prefix

neighbor next-hop-self

neighbor next-hop-unchanged

neighbor password

neighbor peer-group (assigning members)


BGP Commands


Use the commands in this chapter to configure and monitor Border Gateway Protocol (BGP). For BGP configuration information and examples, refer to the "Configuring BGP" chapter of the Cisco IOS IP Configuration Guide. For multiprotocol BGP configuration information and examples, refer to the "Configuring Multiprotocol BGP Extensions for IP Multicast" chapter of the Cisco IOS IP Configuration Guide. For multiprotocol BGP command descriptions, refer to the "Multiprotocol BGP Extensions for IP Multicast Commands" chapter of the Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols.

aggregate-address

To create an aggregate entry in a Border Gateway Protocol (BGP) or multiprotocol BGP database, use the aggregate-address command in address family or router configuration mode. To disable this function, use the no form of this command.

aggregate-address address mask [as-set] [summary-only] [suppress-map map-name] [advertise-map map-name] [attribute-map map-name]

no aggregate-address address mask [as-set] [summary-only] [suppress-map map-name] [advertise-map map-name] [attribute-map map-name]

Syntax Description

address

Aggregate address.

mask

Aggregate mask.

as-set

(Optional) Generates autonomous system set path information.

summary-only

(Optional) Filters all more-specific routes from updates.

suppress-map map-name

(Optional) Name of the route map used to select the routes to be suppressed.

advertise-map map-name

(Optional) Name of the route map used to select the routes to create AS_SET origin communities.

attribute-map map-name

(Optional) Name of the route map used to set the attribute of the aggregate route.


Defaults

This command is disabled by default.

Command Modes

Address family configuration
Router configuration

Command History

Release
Modification

10.0

This command was introduced.

11.1(20)CC

The nlri unicast, nlri multicast, and nlri unicast multicast keywords were added.

12.0(2)S

The nlri unicast, nlri multicast, and nlri unicast multicast keywords were added.

12.0(7)T

The nlri unicast, nlri multicast, and nlri unicast multicast keywords were removed.

Address family configuration mode was added.


Usage Guidelines

You can implement aggregate routing in BGP and multiprotocol BGP either by redistributing an aggregate route into BGP or multiprotocol BGP, or by using this conditional aggregate routing feature.

Using the aggregate-address command with no keywords will create an aggregate entry in the BGP or multiprotocol BGP routing table if any more-specific BGP or multiprotocol BGP routes are available that fall in the specified range. The aggregate route will be advertised as coming from your autonomous system and will have the atomic aggregate attribute set to show that information might be missing. (By default, the atomic aggregate attribute is set unless you specify the as-set keyword.)

Using the as-set keyword creates an aggregate entry using the same rules that the command follows without this keyword, but the path advertised for this route will be an AS_SET consisting of all elements contained in all paths that are being summarized. Do not use this form of the aggregate-address command when aggregating many paths, because this route must be continually withdrawn and reupdated as autonomous system path reachability information for the summarized routes changes.

Using the summary-only keyword not only creates the aggregate route (for example, 193.*.*.*) but also suppresses advertisements of more-specific routes to all neighbors. If you want to suppress only advertisements to certain neighbors, you may use the neighbor distribute-list command, with caution. If a more-specific route leaks out, all BGP or multiprotocol BGP routers will prefer that route over the less-specific aggregate you are generating (using longest-match routing).

Using the suppress-map keyword creates the aggregate route but suppresses advertisement of specified routes. You can use the match clauses of route maps to selectively suppress some more-specific routes of the aggregate and leave others unsuppressed. IP access lists and autonomous system path access lists match clauses are supported.

Using the advertise-map keyword selects specific routes that will be used to build different components of the aggregate route, such as AS_SET or community. This form of the aggregate-address command is useful when the components of an aggregate are in separate autonomous systems and you want to create an aggregate with AS_SET, and advertise it back to some of the same autonomous systems. You must remember to omit the specific autonomous system numbers from the AS_SET to prevent the aggregate from being dropped by the BGP loop detection mechanism at the receiving router. IP access lists and autonomous system path access lists match clauses are supported.

Using the attribute-map keyword allows attributes of the aggregate route to be changed. This form of the aggregate-address command is useful when one of the routes forming the AS_SET is configured with an attribute such as the community no-export attribute, which would prevent the aggregate route from being exported. An attribute map route map can be created to change the aggregate attributes.

Examples

In the following example, a BGP aggregate address is created in router configuration mode. The path advertised for this route will be an AS_SET consisting of all elements contained in all paths that are being summarized.

router bgp 65000
aggregate-address 10.0.0.0 255.0.0.0 as-set

In the following example, a multiprotocol BGP aggregate address is created in address family configuration mode and applied to the multicast database only using an IP Version 4 address family. More-specific routes are filtered from updates.

router bgp 65000
address-family ipv4 multicast
aggregate-address 10.0.0.0 255.0.0.0 summary-only

In the following example, a route map called map-one is created matching on an as-path access list. The path advertised for this route will be an AS_SET consisting of elements contained in paths that are matched in the route map.

ip as-path access-list 1 deny ^1234_
ip as-path access-list 1 permit .*
!
route-map map-one
match ip as-path 1
!
router bgp 65000
aggregate-address 10.0.0.0 255.0.0.0 as-set advertise-map map-one

Related Commands

Command
Description

address-family ipv4

Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.

match ip address

Distributes any routes that have a destination network number address that is permitted by a standard or extended access list, and performs policy routing on packets.

neighbor distribute-list

Distribute BGP neighbor information in an access list.

route-map (IP)

Defines the conditions for redistributing routes from one routing protocol into another, or enables policy routing.


auto-summary (BGP)

To restore the default behavior of automatic summarization of subnet routes into network-level routes, use the auto-summary command in address family or router configuration mode. To disable this feature and send subprefix routing information across classful network boundaries, use the no form of this command.

auto-summary

no auto-summary

Syntax Description

This command has no arguments or keywords.

Defaults

The behavior of this command is enabled by default (the software summarizes subprefixes to the classful network boundary when crossing classful network boundaries).

Command Modes

Address family configuration

Router configuration

Command History

Release
Modification

10.0

This command was introduced.

12.0(7)T

Address family configuration mode was added.


Usage Guidelines

Route summarization reduces the amount of routing information in the routing tables.

By default, BGP does not accept subnets redistributed from Interior Gateway Protocol (IGP). To advertise and carry subnet routes in BGP, use an explicit network command or the no auto-summary command. If you disable automatic summarization and have not entered a network command, you will not advertise network routes for networks with subnet routes unless they contain a summary route.

Examples

In the following router configuration mode example, network numbers are not summarized automatically:

router bgp 6
 no auto-summary

In the following address family configuration mode example, network numbers are not summarized automatically:

router bgp 6
address-family ipv4 unicast
 no auto-summary

Related Commands

Command
Description

address-family ipv4

Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.

address-family vpnv4

Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.


bgp always-compare-med

To allow the comparison of the Multi Exit Discriminator (MED) for paths from neighbors in different autonomous systems, use the bgp always-compare-med command in router configuration mode. To disallow the comparison, use the no form of this command.

bgp always-compare-med

no bgp always-compare-med

Syntax Description

This command has no arguments or keywords.

Defaults

The Cisco IOS software does not compare MEDs for paths from neighbors in different autonomous systems.

Command Modes

Router configuration

Command History

Release
Modification

11.0

This command was introduced.


Usage Guidelines

The MED is one of the parameters that is considered when selecting the best path among many alternative paths. The path with a lower MED is preferred over a path with a higher MED.

By default, during the best-path selection process, MED comparison is done only among paths from the same autonomous system. This command changes the default behavior by allowing comparison of MEDs among paths regardless of the autonomous system from which the paths are received.

Examples

The following example configures the BGP speaker in autonomous system 109 to compare MEDs among alternative paths, regardless of the autonomous system from which the paths are received:

router bgp 109
 bgp always-compare-med

bgp bestpath as-path ignore

To prevent the router from considering as-path as a factor in the algorithm for choosing a route, use the bgp bestpath as-path ignore command in router configuration mode. To allow the router to consider as-path in choosing a route, use the no form of this command.

bgp bestpath as-path ignore

no bgp bestpath as-path ignore

Syntax Description

This command has no arguments or keywords.

Defaults

The router considers as-path in choosing a route.

Command Modes

Router configuration

Command History

Release
Modification

12.0

This command was introduced.


Examples

The following example prevents the BGP router from considering as-path as a factor in choosing a route:

router bgp 210  
 bgp bestpath as-path ignore

Related Commands

Command
Description

show ip bgp ipv4

Displays information about the TCP and BGP connections to neighbors.


bgp bestpath compare-routerid

To compare similar routes received from external BGP (eBGP) peers during the best path selection process and switch the best path to the route with the lowest router ID, use the bgp bestpath compare-routerid command in router configuration mode. To return the router to the default setting, use the no form of this command.

bgp bestpath compare-routerid

no bgp bestpath compare-routerid

Syntax Description

This command has no arguments or keywords.

Defaults

Border Gateway Protocol (BGP) does not compare similar paths received from eBGP peers during the best path selection process and switch the best path to the route with the lowest router ID.

Command Modes

Router configuration

Command History

Release
Modification

12.0

This command was introduced.

12.0 S

This command was introduced.

12.0 ST

This command was introduced.


Usage Guidelines

By default, during the best path selection process, when BGP receives similar routes from eBGP peers (all the attributes are the same except for the router ID), the best path is not switched to the route with the lowest router ID if that route was not the first route received. If the bgp bestpath compare-routerid command is enabled, then similar routes are compared and the best path is switched to the route with the lowest router ID.

Examples

The following example shows the BGP speaker in autonomous system 500 configured to compare the router IDs of similar paths, regardless of the autonomous system from which the paths are received:

router bgp 500
 bgp bestpath compare-routerid

Related Commands

Command
Description

show ip bgp

Displays entries in the BGP routing table.


bgp bestpath med confed

To enable Multi Exit Discriminator (MED) comparison among paths learned from confederation peers, use the bgp bestpath med confed command in router configuration mode. To prevent the software from considering the MED attribute in comparing paths, use the no form of this command.

bgp bestpath med confed

no bgp bestpath med confed

Syntax Description

This command has no arguments or keywords.

Defaults

The software does not consider the MED attribute when choosing among paths learned from confederation peers.

Command Modes

Router configuration

Command History

Release
Modification

12.0

This command was introduced.


Usage Guidelines

The comparison between MEDs is made only if no external autonomous systems are in the path (an external autonomous system is an autonomous system that is not within the confederation). If an external autonomous system in the path, then the external MED is passed transparently through the confederation, and the comparison is not made.

For example, assume that autonomous system 65000, 65001, 65002, and 65004 are part of the confederation; autonomous system 1 is not; and we are comparing route A with four paths. If the bgp bestpath med confed command is enabled, path 1 would be chosen. The fourth path has a lower MED, but it is not involved in the MED comparison because there is an external autonomous system in this path. The following list displays the MED for each autonomous system.

path = 65000 65004, med = 2

path = 65001 65004, med = 3

path = 65002 65004, med = 4

path = 65003 1, med = 1

Examples

The following command enables the BGP router to compare MED values for paths learned from confederation peers:

router bgp 210
 bgp bestpath med confed

Related Commands

Command
Description

show ip bgp

Displays entries in the BGP routing table.

show ip bgp ipv4

Displays information about the TCP and BGP connections to neighbors.


bgp bestpath med missing-as-worst

To have Cisco IOS software consider a missing Multi Exit Discriminator (MED) attribute in a path as having a value of infinity, making the path without a MED value the least desirable path, use the bgp bestpath med missing-as-worst command in router configuration mode. To return the router to the default (assign a value of 0 to the missing MED), use the no form of this command.

bgp bestpath med missing-as-worst

no bgp bestpath med missing-as-worst

Syntax Description

This command has no arguments or keywords.

Defaults

The software assigns a value of 0 to the missing MED, causing the path with the missing MED attribute to be considered the best path.

Command Modes

Router configuration

Command History

Release
Modification

12.0

This command was introduced.


Examples

The following example specifies the BGP router to consider a missing MED attribute in a path as having a value of infinity, making this path the least desirable path:

router bgp 210
 bgp bestpath med missing-as-worst

Related Commands

Command
Description

show ip bgp

Displays entries in the BGP routing table.

show ip bgp ipv4

Displays information about the TCP and BGP connections to neighbors.


bgp client-to-client reflection

To restore route reflection from a BGP route reflector to clients, use the bgp client-to-client reflection command in address family or router configuration mode. To disable client-to-client reflection, use the no form of this command.

bgp client-to-client reflection

no bgp client-to-client reflection

Syntax Description

This command has no arguments or keywords.

Defaults

When a route reflector is configured, the route reflector reflects routes from a client to other clients.

Command Modes

Address family configuration

Router configuration

Command History

Release
Modification

11.1

This command was introduced.

12.0(7)T

Address family configuration mode was added.


Usage Guidelines

By default, the clients of a route reflector are not required to be fully meshed and the routes from a client are reflected to other clients. However, if the clients are fully meshed, route reflection is not required. Use the no bgp client-to-client reflection command to disable client-to-client reflection.

Examples

In the following router configuration mode example, the local router is a route reflector. The three neighbors are fully meshed, so client-to-client reflection is disabled.

router bgp 5
 neighbor 10.24.95.22 route-reflector-client
 neighbor 10.24.95.23 route-reflector-client
 neighbor 10.24.95.24 route-reflector-client
 no bgp client-to-client reflection

In the following address family configuration mode example, the local router is a route reflector. The three neighbors are fully meshed, so client-to-client reflection is disabled.

router bgp 5
address-family ipv4 unicast
 neighbor 10.24.95.22 route-reflector-client
 neighbor 10.24.95.23 route-reflector-client
 neighbor 10.24.95.24 route-reflector-client
 no bgp client-to-client reflection

Related Commands

Command
Description

address-family ipv4

Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.

address-family vpnv4

Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.

bgp cluster-id

Configures the cluster ID if the BGP cluster has more than one route reflector.

neighbor route-reflector-client

Configures the router as a BGP route reflector and configures the specified neighbor as its client.

show ip bgp

Displays entries in the BGP routing table.


bgp cluster-id

To configure the cluster ID if the BGP cluster has more than one route reflector, use the bgp cluster-id command in router configuration mode. To remove the cluster ID, use the no form of this command.

bgp cluster-id cluster-id

no bgp cluster-id cluster-id

Syntax Description

cluster-id

Cluster ID of this router acting as a route reflector; maximum of 4 bytes.


Defaults

The router ID of the single route reflector in a cluster

Command Modes

Router configuration

Command History

Release
Modification

11.0

This command was introduced.


Usage Guidelines

Together, a route reflector and its clients form a cluster.

Usually a cluster of clients will have a single route reflector. In that case, the cluster is identified by the router ID of the route reflector. In order to increase redundancy and avoid a single point of failure, a cluster might have more than one route reflector. In this case, all route reflectors in the cluster must be configured with the 4-byte cluster ID so that a route reflector can recognize updates from route reflectors in the same cluster.

If the cluster has more than one route reflector, use this command to configure the cluster ID.

Examples

In the following example, the local router is one of the route reflectors serving the cluster. It is configured with the cluster ID to identify the cluster.

router bgp 5
 neighbor 198.92.70.24 route-reflector-client
 bgp cluster-id 50000

Related Commands

Command
Description

bgp client-to-client reflection

Restores route reflection from a BGP route reflector to clients.

neighbor route-reflector-client

Configures the router as a BGP route reflector and configures the specified neighbor as its client.

show ip bgp

Displays entries in the BGP routing table.


bgp confederation identifier

To specify a BGP confederation identifier, use the bgp confederation identifier command in router configuration mode. To remove the confederation identifier, use the no form of this command.

bgp confederation identifier as-number

no bgp confederation identifier as-number

Syntax Description

as-number

Autonomous system number that internally includes multiple autonomous systems.


Defaults

No confederation identifier is configured.

Command Modes

Router configuration

Command History

Release
Modification

10.3

This command was introduced.


Usage Guidelines

One way to reduce the internal BGP (iBGP) mesh is to divide an autonomous system into multiple autonomous systems and group them into a single confederation. Each autonomous system is fully meshed within itself and has a few connections to another autonomous system in the same confederation. Even though the peers in different autonomous systems have external BGP (eBGP) sessions, they exchange routing information as if they are iBGP peers. Specifically, the next hop, Multi Exit Discriminator (MED), and local preference information is preserved. The preservation of this information enables to you to retain a single Interior Gateway Protocol (IGP) for all the autonomous systems. To the outside world, the confederation looks like a single autonomous system.

Examples

In the following example, the autonomous system is divided into autonomous systems 4001, 4002, 4003, 4004, 4005, 4006, and 4007 and identified by the confederation identifier 5. Neighbor 10.2.3.4 is someone inside your routing domain confederation. Neighbor 10.4.5.6 is someone outside your routing domain confederation. To the outside world, there appears to be a single autonomous system with the number 5.

router bgp 4001
 bgp confederation identifier 5
 bgp confederation peers 4002 4003 4004 4005 4006 4007
 neighbor 10.2.3.4 remote-as 4002
 neighbor 10.4.5.6 remote-as 510

Related Commands

Command
Description

bgp confederation peers

Configures the autonomous systems that belong to the confederation.


bgp confederation peers

To configure the autonomous systems that belong to the confederation, use the bgp confederation peers command in router configuration mode. To remove an autonomous system from the confederation, use the no form of this command.

bgp confederation peers as-number [... as-number]

no bgp confederation peers as-number [... as-number]

Syntax Description

as-number

Autonomous system numbers for BGP peers that will belong to the confederation.


Defaults

No BGP peers are identified as belonging to the confederation.

Command Modes

Router configuration

Command History

Release
Modification

10.3

This command was introduced.


Usage Guidelines

An ellipsis (...) in the command syntax indicates that your command input can include multiple values for the as-number argument.

The autonomous systems specified in this command are visible internally to a confederation. Each autonomous system is fully meshed within itself. The bgp confederation identifier command specifies the confederation to which the autonomous systems belong.

Examples

The following example specifies that autonomous systems 1090, 1091, 1092, and 1093 belong to a single confederation:

router bgp 1090
 bgp confederation peers 1091 1092 1093

Related Commands

Command
Description

bgp confederation identifier

Specifies a BGP confederation identifier.


bgp dampening

To enable BGP route dampening or change various BGP route dampening factors, use the bgp dampening command in address family or router configuration mode. To disable the function or restore the default values, use the no form of this command.

bgp dampening [half-life reuse suppress max-suppress-time] [route-map map-name]

no bgp dampening [half-life reuse suppress max-suppress-time] [route-map map-name]

Syntax Description

half-life

(Optional) Time (in minutes) after which a penalty is decreased. Once the route has been assigned a penalty, the penalty is decreased by half after the half-life period (which is 15 minutes by default). The process of reducing the penalty happens every 5 seconds. The range of the half-life period is 1 to 45 minutes. The default is 15 minutes.

reuse

(Optional) Reuse values based on accumulated penalties. If the penalty for a flapping route decreases enough to fall below this value, the route is unsuppressed. The process of unsuppressing routes occurs at 10-second increments. The range of the reuse value is from 1 to 20000; the default is 750.

suppress

(Optional) A route is suppressed when its penalty exceeds this limit. The range is from 1 to 20000; the default is 2000.

max-suppress-time

(Optional) Maximum time (in minutes) a route can be suppressed. The range is from 1 to 20000; the default is 4 times the half-life. If the half-life value is allowed to default, the maximum suppress time defaults to 60 minutes. When the max-suppress-time is configured, the maximum penalty will never be exceeded, regardless of the number of times that the prefix dampens. The maximum penalty is computed with the following formula:

Max penalty = reuse-limit *2^(maximum suppress time/half time)

route-map map-name

(Optional) Name of route map that controls where BGP route dampening is enabled.


Defaults

This command is disabled by default

half-life: 15 minutes

reuse: 750

suppress: 2000

max-suppress-time: 4 times half-life

Command Modes

Address family configuration

Router configuration

Command History

Release
Modification

11.0

This command was introduced.

12.0(7)T

Address family configuration mode was added.


Usage Guidelines

If this command is used with no arguments, it enables BGP route dampening. The half-life, reuse, suppress, and max-suppress-time arguments are position-dependent. Therefore, if any of these arguments are issued, they must all be specified.

When BGP dampening is configured and a prefix is withdrawn, BGP considers the withdrawn prefix as a flap and increases the penalty by a 1000. If BGP receives an attribute change, BGP increases the penalty by 500. If then the prefix has been withdrawn, BGP keeps the prefix in the BGP table as a history entry. If the prefix has not been withdrawn by the neighbor and BGP is not using this prefix, the prefix is marked as dampened. Dampened prefixes are not used in the BGP decision process and not installed to the routing table.

Examples

The following router configuration mode example sets the half life to 30 minutes, the reuse value to 1500, the suppress value to 10000, and the maximum suppress time to 120 minutes:

router bgp 5
 bgp dampening 30 1500 10000 120

The following address family configuration mode example sets the half life to 30 minutes, the reuse value to 1500, the suppress value to 10000, and the maximum suppress time to 120 minutes:

router bgp 5
 address-family ipv4 multicast
 bgp dampening 30 1500 10000 120

Related Commands

Command
Description

address-family ipv4

Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.

address-family vpnv4

Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.

clear ip bgp dampening

Clears BGP route dampening information and unsuppresses the suppressed routes.

clear ip bgp flap-statistics

Clears BGP flap statistics.

show ip bgp dampened-paths

Displays BGP dampened routes.

show ip bgp flap-statistics

Displays BGP flap statistics.


bgp default ipv4-unicast

To enable the IP version 4 (IPv4) unicast address family on all neighbors, use the bgp default ipv4-unicast command in address family or router configuration mode. To disable the IPv4 unicast address family on all neighbors, use the no form of this command.

bgp default ipv4-unicast

no bgp default ipv4-unicast

Syntax Description

This command has no arguments or keywords.

Defaults

This command is disabled by default.

Command Modes

Address family

Router configuration

Command History

Release
Modification

12.0(5)T

This command was introduced.


Usage Guidelines

Use the neighbor activate address family configuration command for each neighbor you want to run the bgp default ipv4-unicast command for under the IPv4 unicast address family.

Examples

The following example enables IP version 4 unicast address family on all neighbors:

 bgp default ipv4-unicast

Related Commands

Command
Description

neighbor activate

Enables the exchange of information with a neighboring router.


bgp default local-preference

To change the default local preference value, use the bgp default local-preference command in router configuration mode. To return to the default setting, use the no form of this command.

bgp default local-preference number

no bgp default local-preference number

Syntax Description

number

Local preference value from 0 to 4294967295. Higher is more preferred.


Defaults

Local preference value of 100

Command Modes

Router configuration

Command History

Release
Modification

10.0

This command was introduced.


Usage Guidelines

Generally, the default value of 100 allows you to easily define a particular path as less preferable than paths with no local preference attribute. The preference is sent to all routers and access servers in the local autonomous system.

Examples

The following example raises the default local preference value from the default of 100 to 200:

router bgp 200
 bgp default local-preference 200

Related Commands

Command
Description

set local-preference

Specifies a preference value for the autonomous system path.


bgp deterministic-med

To have Cisco IOS software enforce the deterministic comparison of the Multi Exit Discriminator (MED) variable between all paths received from the same autonomous system, use the bgp deterministic-med command in router configuration mode. To disable the comparison, use the no form of this command.

bgp deterministic med

no bgp deterministic med

Syntax Description

This command has no arguments or keywords.

Defaults

The software does not enforce the deterministic comparison of the MED variable between all paths received from the same autonomous system.

Command Modes

Router configuration

Address-family configuration

Command History

Release
Modification

11.1

This command was introduced.


Usage Guidelines

After the bgp always-compare-med command is configured, all paths for the same prefix that are received from different neighbors, which are in the same autonomous system, will be grouped together and sorted by the ascending MED value (received-only paths are ignored and not grouped or sorted). The best path selection algorithm will then pick the best paths using the existing rules; the comparison is made on a per neighbor autonomous system basis and then global basis. The grouping and sorting of paths occurs immediately after this command is entered. For correct results, all routers in the local autonomous system must have this command enabled (or disabled).

Examples

The following example specifies that the BGP router compare MED variables when choosing among routes advertised by the same subautonomous system within a confederation:

Router(config)# router bgp 204
Router(config-router)# bgp deterministic-med

The following example show ip bgp command output illustrates how route selection is affected by the configuration of the bgp deterministic-med command. The order in which routes are received affects how routes are selected for best path selection when the bgp deterministic-med command is not enabled.

The following sample output from the show ip bgp command shows three paths that are received for the same prefix (10.100.0.0), and the bgp deterministic-med command is not enabled:

router# show ip bgp 10.100.0.0 
BGP routing table entry for 10.100.0.0/16, version 40 
Paths: (3 available, best #3, advertised over IBGP, EBGP) 
  109 
    192.168.43.10 from 192.168.43.10 (192.168.43.1) 
      Origin IGP, metric 0, localpref 100, valid, internal 
  2051 
    192.168.43.22 from 192.168.43.22 (192.168.43.2) 
      Origin IGP, metric 20, localpref 100, valid, internal 
  2051 
    192.168.43.3 from 192.168.43.3 (10.4.1.1) 
      Origin IGP, metric 30, valid, external, best 

If the bgp deterministic-med command is not enabled on the router, the route selection can be affected by the order in which the routes are received. Consider the following scenario in which a router received three paths for the same prefix:

The clear ip bgp * command is entered to clear all routes in the local routing table.

Router# clear ip bgp * 

The show ip bgp command is issued again after the routing table has been repopulated. Note that the order of the paths changed after clearing the BGP session. The results of the selection algorithm also changed. This occurred because the order in which the paths were received was different for the second session.

Router# show ip bgp 10.100.0.0 
BGP routing table entry for 10.100.0.0/16, version 2 
Paths: (3 available, best #3, advertised over EBGP) 
  109 192.168.43.10 from 192.168.43.10 (192.168.43.1) 
      Origin IGP, metric 0, localpref 100, valid, internal 
  2051 
    192.168.43.3 from 192.168.43.3 (10.4.1.1) 
      Origin IGP, metric 30, valid, external 
  2051 
    192.168.43.22 from 192.168.43.22 (192.168.43.2) 
      Origin IGP, metric 20, localpref 100, valid, internal, best 

If the bgp deterministic-med command is enabled, then the result of the selection algorithm will always be the same, regardless of the order in which the paths are received by the local router. The following output is always generated when the bgp deterministic-med command is entered on the local router in this scenario:

Router# show ip bgp 10.100.0.0 
BGP routing table entry for 10.100.0.0/16, version 15 
Paths: (3 available, best #1, advertised over EBGP) 
  109 
    192.168.43.10 from 192.168.43.10 (192.168.43.1) 
      Origin IGP, metric 0, localpref 100, valid, internal, best 3 
    192.168.43.22 from 192.168.43.22 (192.168.43.2) 
      Origin IGP, metric 20, localpref 100, valid, internal 3 
    192.168.43.3 from 192.168.43.3 (10.4.1.1) 
      Origin IGP, metric 30, valid, external 

Related Commands

Command
Description

clear ip bgp

Resets a BGP connection or session.

show ip bgp

Displays entries in the BGP routing table.

show ip bgp neighbors

Displays information about the TCP and BGP connections to neighbors.


bgp fast-external-fallover

To immediately reset the BGP sessions of any directly adjacent external peers if the link used to reach them goes down, use the bgp fast-external-fallover command in address family or router configuration mode. To disable this function, use the no form of this command.

bgp fast-external-fallover

no bgp fast-external-fallover

Syntax Description

This command has no arguments or keywords.

Defaults

The behavior of this command is enabled by default.

Command Modes

Address family configuration

Router configuration

Command History

Release
Modification

10.0

This command was introduced.

12.0(7)T

Address family configuration mode was added.


Examples

The following example disables the automatic resetting of BGP sessions in router configuration mode:

router bgp 109
 no bgp fast-external-fallover

The following example disables the automatic resetting of BGP sessions in address family configuration mode:

router bgp 109
address-family ipv4 unicast
 no bgp fast-external-fallover

Related Commands

Command
Description

address-family ipv4

Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.


bgp log-neighbor-changes

To enable logging of BGP neighbor resets, use the bgp log-neighbor-changes command in address family or router configuration mode. To disable the logging of changes in BGP neighbor adjacencies, use the no form of this command.

bgp log-neighbor-changes

no bgp log-neighbor-changes

Syntax Description

This command has no arguments or keywords.

Defaults

BGP neighbor changes are logged.

Command Modes

Address family configuration

Router configuration

Command History

Release
Modification

11.1 CC

This command was introduced.

12.0

This command was introduced.

12.0(7)T

Address family configuration mode was added.

12.0(1)

BGP neighbor changes are logged by default.


Usage Guidelines

The bgp log-neighbor-changes command enables logging of BGP neighbor status changes (up or down) and resets for troubleshooting network connectivity problems and measuring network stability. Unexpected neighbor resets might indicate high error rates or high packet loss in the network and should be investigated.

Using the bgp log-neighbor-changes command to enable status change message logging does not cause a substantial performance impact, unlike, for example, enabling per BGP update debugging. If the UNIX syslog facility is enabled, messages are sent to the UNIX host running the syslog daemon so that the messages can be stored and archived. If the UNIX syslog facility is not enabled, the status change messages are retained in the internal buffer of the router, and are not stored to disk. You can set the size of this buffer, which is dependent upon the available RAM, using the logging buffered command.

The neighbor status change messages are not tracked if the bgp log-neighbor-changes command is not enabled, except for the reset reason, which is always available as output of the show ip bgp neighbors command.

The eigrp log-neighbor-changes command enables logging of Enhanced IGRP (EIGRP) neighbor adjacencies, but messages for BGP neighbors are logged only if they are specifically enabled with the bgp log-neighbor-changes command.

Use the show logging command to display the log for the BGP neighbor changes.

Examples

The following example logs neighbor changes for BGP in router configuration mode:

bgp router 100
 bgp log-neighbor-changes

The following example logs neighbor changes for BGP in address family configuration mode:

bgp router 100
address-family ipv4 unicast
 bgp log-neighbor-changes

Related Commands

Command
Description

address-family ipv4

Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.

eigrp log-neighbor-changes

Enables the logging of neighbor adjacency changes to monitor the stability of the routing system and to help detect problems.

logging buffered

Logs messages to an internal buffer.

show ip bgp ipv4

Displays information about the TCP and BGP connections to neighbors.

show ip bgp neighbors

Displays information about BGP neighbors.

show logging

Displays the state of logging (syslog).



bgp maxas-limit

To configure Border Gateway Protocol (BGP) to discard routes that have a number of as-path segments that exceed the specified value, use the bgp maxas-limit command in router configuration mode. To return the router to default operation, use the no form of this command.

bgp maxas-limit number

no bgp maxas-limit

Syntax Description

number

Specifies the number of autonomous system segments. The value that can be entered for this argument is a number from 1 to 2000.


Defaults

The default value in Cisco IOS software for the number argument is 75.

Command Modes

Router configuration

Command History

Release
Modification

12.2

This command was introduced.

12.0(17)S

This command was integrated into Cisco IOS Release 12.0(17)S.


Usage Guidelines

The bgp maxas-limit command is used to limit the number of as-path segments that are permitted in inbound routes. If a route is received with an as-path segment that exceeds the configured limit, the BGP routing process will discard the route.

Examples

In the following example, the maximum as-path segment length is set to 30:

Router(config)# router bgp 40000
Router(config-router-af)# bgp maxas-limit 30 

Related Commands

Command
Description

clear ip bgp

Resets a BGP connection or session.


bgp redistribute-internal

To allow the redistribution of iBGP routes into an interior gateway protocol such as IS-IS or OSPF, use the bgp redistribute-internal command in router configuration mode. To remove the bgp redistribute-internal command from the configuration file and restore the system to its default condition where the software does not allow the redistribution of iBGP routes into Interior Gateway Protocols (IGPs), use the no form of this command.

bgp redistribute-internal

no bgp redistribute-internal

Syntax Description

This command has no arguments or keywords.

Defaults

By default iBGP routes are not redistributed into IGPs.

Command Modes

Router configuration

Command History

Release
Modification

12.1

This command was introduced.


Usage Guidelines

Use of the bgp redistribute-internal command requires the clear ip bgp command to be issued to reset BGP connections.


Caution Redistributing iBGP routes into IGPs may cause routing loops to form within an autonomous system. Use this command with caution.

Examples

The following example shows iBGP routes being redistributed into OSPF:

router ospf 300
	 redistribute bgp 200
!
router bgp 200
	 bgp redistribute-internal
!
clear ip bgp *

Related Commands

Command
Description

clear ip bgp

Resets a BGP connection or session.


bgp router-id

To configure a fixed router ID for a BGP-speaking router, use the bgp router-id command in router configuration mode. To remove the bgp router-id command from the configuration file and restore the default value of the router ID, use the no form of this command.

bgp router-id ip-address

no bgp router-id ip-address

Syntax Description

ip-address

IP address of the router.


Defaults

The router ID is set to the IP address of a loopback interface if one is configured. If no virtual interfaces are configured, the highest IP ad