Tip

This is the documentation for the 23.11 version. Looking for the documentation of the latest version? Have a look here.

BGP Router ConfigurationΒΆ

This statement enters BGP server mode for the specified VRF and enters config-bgp mode.

tnsr(config)# route dynamic bgp
tnsr(config-frr-bgp)# server vrf default
tnsr(config-bgp)#

Warning

Older versions of TNSR specified the ASN here, rather than a VRF name. That format has been deprecated. The ASN is still mandatory, but is now set by the as-number <asn> command within config-bgp mode.

BGP mode defines the main behaviors of the BGP daemon, as well as the neighbors and behavior of BGP for different address families, among other possibilities.

From within config-bgp mode, the following commands are available:

as-number <asn>:

Mandatory. Sets the autonomous system number for this BGP instance.

address-family (ipv4|ipv6) (unicast|multicast):

Enter BGP Address Family Configuration mode.

allow-martian-nexthop:

Allow Martian next hops.

Martians are addresses that would otherwise be considered invalid such as reserved private networks and link-local addresses.

always-compare-med:

Instructs the BGP daemon to always consult MED values in routes, no matter which AS the routes were received through.

bestpath as-path (confed|ignore|multipath-relax|as-set|no-as-set):

Controls how the BGP daemon determines the best path to a destination. May be one of:

confed:

Considers the length of confederation path sets and sequences.

ignore:

Ignores AS path lengths when computing the route to a destination.

multipath-relax:

Consider paths of equal length when choosing between multiple paths to a destination, rather than looking for an exact match. This allows load sharing across different AS paths, so long as they are of equal length.

as-set:

For use with multipath-relax, it adds AS set information for aggregate routes.

no-as-set:

For use with multipath-relax, it prevents AS set generation.

bestpath compare-routerid:

Uses the router ID of peers (or originator ID, if present) to break ties when computing paths to a destination based on other information. A lower router ID will win in a tie.

bestpath med confed:

Compare confederation path MEDs

bestpath med missing-as-worst:

If a route is missing MED information, it will be considered least preferred.

client-to-client reflection:

Enables reflection of routes from one client to another client.

cluster-id (<ipv4>|<value>):

Configures the BGP daemon to participate in route reflection with the given cluster ID. The ID may be given in IP address (dotted quad) notation or as an unsigned 32-bit integer (1-4294967295).

Warning

If the ID is set to an integer the BGP daemon converts the ID to the equivalent IP address value internally. Thus, when viewing the running BGP configuration, the cluster ID value will always display as an IP address.

coalesce-time <value>:

Configures the Subgroup coalesce timer, in milliseconds (1-4294967295).

confederation identifier <ASN>:

Configures an AS number for the entire group of IBGP routers participating in confederation.

confederation peer <ASN>:

Configures the sub-AS number for the subset of peers inside a group of IBGP routers participating in confederation.

dampening [penalty <val> [reuse <val> [suppress <val> [maximum <max>]]]]:

This command enables BGP route flap dampening (RFC 2439) to prevent unstable routers from adversely affecting routing behavior.

penalty <penalty-val>:

The time duration during which the stability value will be reduced by half if the route is unreachable.

reuse <reuse-val>:

Stability threshold that must be crossed for a route to be reused.

suppress <suppress-val>:

Stability threshold that, when crossed, a route will be suppressed.

maximum <suppress-max>:

Maximum time to suppress a route considered stable.

deterministic-med:

Determine route selection locally, even when MED values are present. Picks the best MED path from neighbor advertisements.

disable-ebgp-connected-route-check:

Disable checking if nexthop is an eBGP session.

ebgp-requires-policy:

Determines whether or not BGP will exchange routes with peers when a policy is not present allowing that to take place. For example, with this active, BGP will not exchange routes with a neighbor unless there is a route map configured on the address family neighbor entry which matches and permits the routes inbound and outbound.

Note

This behavior is enabled by default on new configurations in TNSR 21.07 and later, and is disabled when upgrading from older installations to preserve the pre-existing behavior in those environments. To disable, use no ebgp-requires-policy.

Warning

Consider creating appropriate route maps and using them rather than disabling the policy check, as using policies is a more secure behavior, and can prevent unintended routes from being exchanged.

ipv4-unicast-enabled:

Controls whether or not all BGP peers (IPv4 and IPv6) are automatically included in the IPv4 unicast routing address family by default.

This behavior is active by default and can be deactivated by negating the directive (no ipv4-unicast-enabled).

When this directive is active, all peers (IPv4 and IPv6) can exchange IPv4 unicast routes by default.

When this directive is negated peers must be manually added to the IPv4 unicast address family to exchange IPv4 routes.

Tip

Users who prefer to keep their IPv4 and IPv6 peers separate can opt to disable this behavior and then add the peers into their appropriate IPv4 or IPv6 unicast address families manually.

Note

Most examples in the documentation already include adding IPv4 peers to the IPv4 address family manually, so users following those examples need not make further adjustments for IPv4 peers when changing this setting.

listen limit <value>:

Maximum number of dynamic neighbors from 1-5000.

listen range (<ip4-prefix>|<ip6-prefix>) peer-group <peer-group-name>:

Listen range for dynamic neighbors.

log-neighbor-changes:

Instructs the BGP daemon to log changes in neighbor adjacencies. This is useful for tracking changes to neighbor relationships, especially during initial configuration.

See also

See Logging for information on dynamic routing logging.

max-med administrative [<med>]:

Sends the defined MED value, or 4294967294 when unset, at all times.

max-med on-startup period <seconds> [<med>]:

Sends the defined MED value, or 4294967294 when unset, only at startup for the defined period in seconds, from 5-86400.

neighbor <peer>:

Enter BGP Neighbor Configuration mode.

network import-check:

Checks if a BGP network route exists in IGP before creating BGP table entries.

Note

This behavior is enabled by default on new configurations in TNSR 21.07 and later, and is disabled when upgrading from older installations to preserve the pre-existing behavior in those environments. To disable, use no network import-check.

route-reflector allow-outbound-policy:

Allows attributes modified by route maps to be reflected.

router-id <A.B.C.D>:

Sets the router ID for the BGP daemon. This is typically set to an IP address unique to this router, and commonly is set to a local private address.

timers keep-alive <interval> hold-time <hold-time>:

Configures the intervals between keep alive messages and how long to wait for a response before considering the peer unreachable.

Note

When changing these values the BGP session must be restarted to reflect the new timers. This can be accomplished by clearing the session, for example:

tnsr(config)# route dynamic bgp
tnsr(config-frr-bgp)# session clear *
tnsr(config-frr-bgp)# exit
tnsr(config)# exit
update-delay <delay>:

Keeps BGP in a read-only mode for the specified time after the daemon restarts or peers are cleared.

write-quanta <packets>:

Controls the size of peer update transmissions.