2. 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 Figure 4, 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 bgp- Configure the group and peer's IP address:
[edit protocols bgp]user@host#set groupgroup-nametypetypeneighborneighbor-address
NOTE: For external neighbors, use the following form of the command that includes the peer's AS number:
user@host#set groupgroup-nameneighborneighbor-addresspeer-aspeer-as-number- Configure the local address:
[edit protocols bgp]user@host#set groupgroup-namelocal-addresslocal-address- Verify and commit the configuration:
user@host#showuser@host#commitSample Output
user@R1>editEntering 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#showgroup 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#commitcommit completeWhat It Means
The sample output shows that router
R1is in an internal group with five BGP neighbors. Thelocal-addressstatement 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 thelocal-addressstatement is included in the configuration. Generally, you would not configure a local address when external BGP is configured.