The following configuration tasks are described as required or optional.
Task | Remarks | |
---|---|---|
Configuring BGP connection | Required | |
Controlling route distribution and reception | Configuring BGP route redistribution | Optional |
Configuring BGP route distribution filtering policies | Optional | |
Configuring BGP route reception filtering policies | Optional | |
Routemap filtering and route modifications | Optional | |
Configuring BGP route attributes | Optional | |
Tuning and optimizing BGP networks | Optional | |
Configuring BGP community | Optional | |
Configuring BGP GR | Optional |
-
A router ID is the unique identifier of a BGP router in an AS.
-
To ensure the uniqueness of a router ID and enhance network reliability, you can specify in BGP configuration context the IP address of a local loopback interface as the router ID.
-
If no router ID is specified in BGP context, the global router ID is used.
-
If the global router ID is used and then it is removed, the system will select a new router ID.
-
Unconfiguring the router ID in BGP context can make the system select a new router ID.
Follow these steps to create a BGP connection:
To do... | Use the command... | Remarks |
---|---|---|
Enter global configuration context | configuration |
|
Enter BGP context | router bgp |
Not enabled by default |
Enable BGP | enable |
|
Specify a BGP Router ID | bgp router-id |
Optional. By default, the global router ID is used. |
Specify a neighbor and its AS number | neighbor { remote-as as-number |
Required |
Configure a description for a neighbor | neighbor { description |
Optional. Not configured by default |
|
|
CAUTION: Since a router can reside in only one AS, the router can run only one BGP process. |
|
|
BGP uses TCP as the transport layer protocol. By default, BGP uses the output interface of the optimal router to a peer as the source interface for establishing TCP connections to the peer. If a BGP router has multiple links to a peer, when the source interface fails, BGP has to reestablish TCP connections, causing network oscillation. Therefore, it is recommended to use a loopback interface as the source interface to enhance stability of BGP connections.
Follow these steps to specify the source interface of TCP connections:
To do... | Use the command... | Remarks |
---|---|---|
Enter global configuration context | configuration |
|
Enter BGP context | bgp |
|
Specify the source interface for establishing TCP connections to a neighbor. | neighbor { update-source { |
Required. By default, BGP uses the outbound interface of the best route to the BGP peer as the source interface for establishing a TCP connection to the peer. |
BGP requires TCP as the transport protocol. To enhance security, you can configure BGP to perform MD5 authentication when establishing a TCP connection. The two parties must have the same password configured to establish TCP connections. BGP MD5 authentication is not for BGP packets, but for TCP connections. If the authentication fails, no TCP connection can be established.
In general, direct physical links should be available between eBGP peers. If not, you can use the neighbor ip-address ebgp-multihop
command to establish a TCP connection over multiple hops between two peers.
Follow these steps to allow establishment of eBGP connection to a non-directly connected peer.
You can redistribute IGP routes into BGP. During route redistribution, BGP can filter routing information from specific routing protocols.
To do... | Use the command... | Remarks |
---|---|---|
Enter global configuration context | configuration |
|
Enter BGP context | router bgp as-number |
|
Redistribute from other protocols | redistribute |
Redistributes other protocol routes into BGP |
Follow these steps to configure BGP route reception filtering policies:
To do... | Use the command... | Remarks |
---|---|---|
Enter global Configuration context | configuration |
|
Enter BGP context | bgp |
|
Apply filter policy on the inbound or the outbound for each peer | neighbor route-map |
|
|
CAUTION: Only routes permitted by the specified filtering policies can be installed into the local BGP routing table. |
|
|
You can configure BGP route attributes to influence BGP route selection.
Follow these steps to configure BGP route attributes.
To do... | Use the command... | Remarks |
---|---|---|
Enter global configuration context | configuration |
|
Enter BGP context | bgp |
|
Configure preferences for external, internal, local routes | preference { |
Optional. The default preferences of external, internal, and local routes are 20, 200, and 200 respectively. |
Configure weight to be assigned to received routes from a peer | neighbor { |
Optional |
Specify the router as the next hop of routes sent to a peer | neighbor { |
Optional. By default, advertisements to an eBGP peer take the router as the next hop, while advertisements to an iBGP peer do not take the local router as the next hop. |
Configure the AS_PATH attribute: | ||
Configure repeating times of local AS number in routes from a peer | neighbor { |
Optional. The local AS number cannot be repeated in routes from the peer. |
Specify a fake AS number for a peer | neighbor { |
Optional. Not specified by default This command is only applicable to an eBGP peer. |
Substitute local AS number for the AS number of a peer in the AS_PATH attribute | neighbor { |
Optional. The substitution is not configured by default. |
Configure BGP to not keep private AS numbers in the AS_PATH attribute of updates to a peer | neighbor { |
Optional. By default, BGP updates carry private AS numbers. |
|
|
CAUTION:
|
|
|
After establishing a BGP connection, two routers send keepalive messages periodically to each other to keep the connection. If a router receives no keepalive or update message from the peer within the holdtime, it breaks the connection.
If two parties have the same timer assigned with different values, the smaller one is used.
Follow these steps to configure BGP keepalive interval and holdtime.
To do... | Use the command... | Remarks |
---|---|---|
Enter global configuration context | configuration |
|
Enter BGP context | bgp as-number |
|
Configure the global keepalive interval and holdtime | timers { |
|
Configure the keepalive interval and holdtime for a peer | neighbor { |
Optional. By default, the keepalive interval is 60 seconds, and holdtime is 180 seconds. |
|
|
CAUTION:
|
|
|
In a large-scale BGP network, configuration and maintenance become difficult due to large numbers of BGP peers. To facilitate configuration in this case, you can configure community or route reflector as needed.
A BGP community must be configured. Follow these steps.
To do... | Use the command... | Remarks |
---|---|---|
Enter the global configuration context | configuration |
|
Enter the BGP context | bgp as-number |
|
Advertise the community attribute to a peer | neighbor { |
Enabled by default |
|
|
CAUTION: When configuring the BGP community, you must configure a routing policy to define the community attribute, and then apply the routing policy to the route advertisement. |
|
|
Follow these steps to configure a BGP route reflector:
To do... | Use the command... | Remarks |
---|---|---|
Enterthe global configuration context | configuration |
|
Enter the BGP context | bgp |
|
Configure the router as a route reflector and specify a peer as its client | client-to-client-reflection |
Enabled by default |
Enable route reflection between clients | neighbor { |
Optional. Enabled by default. |
Perform the following configuration on the GR Restarter and GR Helper respectively.
|
|
NOTE: A device can act as both the GR Restarter and GR Helper simultaneously. |
|
|
Follow these steps to configure BGP GR.
To do... | Use the command... | Remarks |
---|---|---|
Enter the global Configuration context | configuration |
|
Enable BGP, and enter its view | bgp as-number |
|
Configure graceful restart | bgp graceful-restart staleparth-time { |
Required. Disabled by default. |
Configure the maximum time allowed for the peer to reestablish a BGP session | graceful-restart timer restart |
Optional. 120 seconds by default. |
Configure the maximum time to wait for the End-of-RIB marker | graceful-restart timer |