Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Set Up BGP on Routers in Your Network

 

Before BGP can function in your MPLS network, you must define the autonomous system (AS) number on the routers in your network, and configure at least one group that includes at least one peer.

Optionally, you can configure a routing policy. The routing policy allows you to control the information shared with BGP neighbors and provides the opportunity to filter and modify the information you receive.

Figure 1: BGP Network Topology
BGP Network Topology

The BGP configuration in the MPLS network in Figure 1 consists of the following:

  • A full-mesh IBGP topology, using AS 65432.

  • All IBGP sessions peer between loopback addresses because significant stability advantages are gained.

  • All routers are configured with one group, group internal.

  • A send-statics policy on routers R1 and R6 allows a new route to be advertised into the network.

The example network uses IS-IS Level 2 and a policy to create routes that are reachable through the LSP. However, IS-IS Level 1 or an OSPF area can be used and the policy omitted if the network has existing BGP traffic.

You can set up BGP throughout the rest of the network by repeating Step 1, Define the Local Autonomous System through Step 3, Configure a Simple Routing Policy as appropriate on other routers until all routers are set up with BGP.

To set up BGP on routers in your network, follow these steps:



Define the Local Autonomous System

Purpose

Before BGP can function, you need to define a local AS number on the routers in your network. In the example network in BGP Network Topology, all routers are in AS 65432.

Action

To define an AS number on routers in your network, follow these steps:

  1. In configuration mode, go to the following hierarchy level:

  2. Configure all interfaces to a specific AS:

  3. Verify the configuration:

Sample Output

Meaning

The output shows that router R1 resides in AS 65432. All other routers in the example network shown in BGP Network Topology also reside in AS 65432.



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:

  1. In configuration mode, go to the following hierarchy level:

  2. Configure the group and peer’s IP address:

    Note

    For external neighbors, use the following form of the command that includes the peer’s AS number:

  3. Configure the local address:

  4. Verify and commit the configuration:

Sample Output

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.



Configure a Simple Routing Policy

Purpose

Routing policy allows you to control the information shared with BGP neighbors and provides the opportunity to filter and modify the information you receive. Typically, a network is injected into BGP using a policy. This may also be done through a static route. In the network in BGP Network Topology, a static route export policy is used to inject routes into BGP.

Action

To configure a simple routing policy, follow these steps:

  1. In configuration mode, go to the following hierarchy level:

  2. Configure a static route for redistribution to other autonomous systems:

  3. Configure a routing policy that matches and accepts the configured static routes into BGP updates:

  4. Apply the policy created in Step 3 to all BGP neighbors:

  5. Verify and commit the configuration:

Sample Output

Meaning

The sample output shows that routing policy send-statics is configured on the router. The routing policy matches and accepts the configured static routes into the routing table and injects the routes into BGP updates. Typically, a routing policy is applied at the group level, although it can be applied at the global level, as shown in this example.



Verify That BGP Sessions Are Up

Purpose

After configuring BGP, you must verify that BGP peers are established and the sessions are up.

Action

To verify BGP peers and sessions, enter the following Junos OS CLI operational mode command:

Sample Output

Meaning

The sample output from the ingress, transit, and egress routers shows that all routers in the network shown in BGP Network Topology have BGP peers established and sessions up.