Configure BGP Neighbor Connections
Purpose
You must configure at least one group that includes at least one peer for BGP to run in your network. First determine which neighbors are internal or external to your local AS boundary. Internal neighbors are inside your local AS boundary. In the example network shown in BGP Network Topology, all the routers are in one AS and are therefore internal. In this example, all IBGP sessions peer between loopback addresses because significant stability advantages are gained. For more information about configuring BGP neighbor connections, see the Junos Routing Protocols Configuration Guide.
Action
To configure BGP neighbor connections, follow these steps:
In configuration mode, go to the following hierarchy level:
[edit]user@host# edit protocols bgpConfigure the group and peer’s IP address:
[edit protocols bgp]user@host# set group group-name type type neighbor neighbor-addressNote For external neighbors, use the following form of the command that includes the peer’s AS number:
user@host# set group group-name neighbor neighbor-address peer-as peer-as-numberConfigure the local address:
[edit protocols bgp]user@host# set group group-name local-address local-addressVerify and commit the configuration:
user@host# showuser@host# commit
Sample Output
user@R1> edit Entering configuration mode [edit] user@R1# edit protocols bgp [edit protocols bgp] user@R1# set group internal type internal neighbor 10.0.0.2 [edit protocols bgp] users@R1# set group internal local-address 10.0.0.1 [edit protocols bgp] user@R1# show group internal { type internal; local-address 10.0.0.1; neighbor 10.0.0.2; neighbor 10.0.0.3; neighbor 10.0.0.5; neighbor 10.0.0.4; neighbor 10.0.0.6; } [edit protocols bgp] user@R1# commit commit complete
Meaning
The sample output shows that router R1 is in an internal group with five BGP neighbors. The local-address statement is included in this example configuration because IBGP is used. It is considered best practice to configure a local address when you use an IBGP. BGP messages are sourced from the loopback address because the local-address statement is included in the configuration. Generally, you would not configure a local address when external BGP is configured.