Configure BGP

Before you begin

  • To configure the suppress-map, advertise-map, or attribute-map options, the route policy for those options must exist.

  • For initial BGP configuration, you must know the AS number.

  • You configure BGP on a VRF instance the same way you configure the GlobalRouter, except that you must use VRF Router Configuration mode and the prefix ip bgp. The VRF must have an RP Trigger of BGP.

    Note

    Note

    Route refresh is not currently supported on non-default VRFs.

About this task

Configure BGP globally to enable BGP on the switch and determine how BGP operates.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Specify the AS number and enable BGP:

    router bgp [WORD <0-11>] [enable]

    Note

    Note

    • This command applies only on VRF 0. To enable BGP globally on other VRFs, use the ip bgp enable command. You must configure BGP locally before you configure it globally.

    • You can also configure AS number on non-default VRFs. For more information, see Configure an AS Number for a Non-default VRF.

  3. Access Router BGP Configuration mode:

    router bgp

  4. Configure BGP variables or accept the default values.

Example

Specify the AS number and enable BGP:

Switch:1>enable
Switch:1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch:1(config)#router bgp 3 enable

Variable Definitions

The following table defines parameters for the router bgp command.

Variable

Value

WORD <0-11>

Specifies the AS number. You cannot enable BGP until you change the local AS to a value other than 0.

enable

Enables BGP on the router.

Use the data in the following table to use the BGP variables in BGP and VRF Router Configuration mode.

Variable

Value

aggregate-address WORD<1-256>

Specifies an IP address and its length in the form {a.b.c.d/len}, or an IPv6 address and its length in the form {ipv6addr/len}.

auto-peer-restart enable

Enables the process that automatically restarts a connection to a BGP neighbor. The default value is enable.

auto-summary

When enabled, BGP summarizes networks based on class limits, for example, Class A, B, and C networks. The default value is enable.

bgp always-compare-med

Enables the comparison of the multi-exit discriminator (MED) parameter for paths from neighbors in different autonomous systems. The system prefers a path with a lower MED over a path with a higher MED. The default value is disable.

bgp aggregation

Enables the aggregation feature on the interface.

bgp client-to-client reflection

Enables or disables route reflection between two route reflector clients. This variable applies only if the route reflection value is enable. The default value is disable. You can enable route reflection even when clients are fully meshed.

This variable only applies to VRF 0.

bgp cluster-id {A.B.C.D}

Configures a cluster ID. This variable applies only if the route reflection value is enable, and if multiple route reflectors are in a cluster. {A.B.C.D} is the IP address of the reflector router.

This variable only applies to VRF 0.

bgp confederation identifier <0-4294967295> [peers WORD<0-255>]

Configures a BGP confederation.

identifier<0-4294967295> specifies the confederation identifier. Use 0–65535 for 2-byte AS and <0-4294967295> for 4-byte AS.

peers WORD<0-255> lists adjoining autonomous systems that are part of the confederation in the format (5500,65535,0,10,...,...). Use quotation marks (") around the list of autonomous systems.

Note:

Use this command only on VRF 0.

bgp default local-preference <0-2147483647>

Specifies the default value of the local preference attribute. The default value is 0. You must disable BGP before you can change the default value.

bgp deterministic-med enable

Enables deterministic MED.

bgp multiple-paths <1-8>

Configures the maximum number of equal-cost-paths that are available to a BGP router by limiting the number of equal-cost-paths the routing table can store. The default value is 1.

Note:

Configuring the bgp multiple-paths variable does not affect existing routes. The routing table does not show ECMP routes; instead only one route is shown in the routing table.

To view Equal-Cost Multipath (ECMP) routes, receive the routes after executing the bgp multiple-paths variable, or toggle the BGP state.

The number of equal-cost-paths supported can differ by hardware platform. For more information, see Fabric Engine Release Notes.

comp-bestpath-med-confed enable

When enabled, compares MED attributes within a confederation. The default value is disable.

This variable only applies to VRF 0.

debug-screen <off|on>

Displays debug messages on the console, or saves them in a log file. Disable BGP screen logging (off) or enable BGP screen logging (on).

default-information originate

Enables the advertisement of a default route to peers, if the route exists in the routing table. The default value is disable.

default-information ipv6-originate

Enables the advertisement of an IPv6 default route to peers, if the route exists in the routing table. The default value is disable.

default-metric <-1-2147483647>

Configures a value to send to a BGP neighbor to determine the cost of a route a neighbor uses. A default metric value solves the problems associated with redistributing routes that use incompatible metrics. For example, whenever metrics do not convert, using a default metric provides a reasonable substitute and redistribution proceeds. Use this option in conjunction with the redistribute commands so the current routing protocol uses the same metric for all redistributed routes. The default value is 0.

flap-dampening enable

Enables route suppression for routes that flap on and off. The default value is disable.

global-debug mask WORD<1-100>

Displays specified debug information for BGP global configurations. The default value is none.

  • <WORD 1-100> is a list of mask choices separated by commas with no space between choices.

Mask choices are:

  • none disables all debug messages.

  • all enables all debug messages.

  • error enables display of debug error messages.

  • packet enables display of debug packet messages.

  • event enables display of debug event messages.

  • trace enables display of debug trace messages.

  • warning enables display of debug warning messages.

  • state enables display of debug state transition messages.

  • init enables display of debug initialization messages.

  • filter enables display of debug messages related to filtering.

  • update enables display of debug messages related to sending and receiving updates.

ibgp-report-import-rt enable

Configures BGP to advertise imported routes to an interior BGP (iBGP) peer. This variable enables or disables advertisement of nonBGP imported routes to other iBGP neighbors. The default value is enable.

ignore-illegal-rtrid enable

When enabled, BGP overlooks an illegal router ID. For example, you can configure this variable to enable or disable the acceptance of a connection from a peer that sends an open message using a router ID of 0 (zero). The default value is enable.

neighbor-debug-all mask WORD<1-100>

Displays specified debug information for BGP neighbors. The default value is none. For mask options, see the global-debug mask WORD<1-100> variable.

no-med-path-is-worst enable

Enables BGP to treat an update without a MED attribute as the worst path. The default value is disable.

quick-start enable

Enables the quick-start flag for exponential backoff.

route-reflector enable

Enables the reflection of routes from iBGP neighbors. The default value is disable.

This variable only applies to VRF 0.

route-refresh

Enables or disables route refresh. If enabled, a route refresh request received by a BGP speaker causes the speaker to resend all route updates it contains in its database that are eligible for the peer that issues the request.

This variable only applies to VRF 0.

router-id {A.B.C.D}

Specifies the BGP router ID in IP address format. This variable only applies to VRF 0.

synchronization

Enables the router to accept routes from BGP peers without waiting for an update from the IGP. The default value is enable.

traps enable

Enables BGP traps.

vrf-as WORD<0-11>

Configures an AS number on a specific VRF instance. Use 0–65535 for a 2-byte AS and <0-4294967295> for a 4-byte AS.

The default value of 0, or configuring the local-as in the VRF to 0, is equivalent to deleting the local-as configured on user-defined VRFs, and in both cases the local-as on the VRF becomes the local-as on the GlobalRouter.

Job Aid

Use debug command values to control debug messages for global BGP message types, and for message types associated with a specified BGP peer or peer group.

Tip

Tip

The following tips can help you use the debug commands:

  • Display debug commands for multiple mask choices by entering the mask choices separated by commas, with no space between choices.

  • To end (disable) the display of debug messages, use the mask choice of none.

  • You can save debug messages in a log file, or you can display the messages on your console using the debug-screen command.

For more information about the logged debug messages, see Fabric Engine Alarms and Logs Reference.