To allow connections between BGP neighbors that are not directly connected to each other, you can configure EBGP multihop routing with either a route map or static routes. This article provides example scenarios and step-by-step instructions for configuring EBGP.
Choosing to Use a Routing Map or Static Routes
There are different scenarios that may require the implementation of EBGP multihop routing - for example, as illustrated in the following diagrams:
- Scenario 1 – A BGP peer runs on a loopback address that is externally unreachable. This can be required if the other IP addresses of the system are dynamically changeable.
- Scenario 2 – The BGP peer (router R1) is located in an external network.
For both scenarios, you can configure EBGP multihop routing with either a route map or static routes:
- Route Map – If you do not require load balancing over more than one router, using a route map is the simplest way of configuring EBGP. You only need to configure the BGP neighbor and do not need to introduce additional routes. All routes learned by router R1 (as configured in Scenario 2) are directed over one gateway. However, this setup can prolong traffic from routes whose next hop would initially have been directly reachable from router R0, and load balancing over more than one router is no more possible.
- Static Routes – For arriving routes without a directly reachable next hop, configure static routes. You only need to configure the neighbor once for EBGP multihop routing and do not need to change any other BGP configurations. Routes received via next hop can be analyzed. However, you must also set up a new next hop, and the routing table for the kernel becomes more complicated.
Complete the steps in the following sections to configure EBGP multihop routing with either a route map or static routes, depending on your network architecture. The sections provide examples of how to configure EBGP multihop routing for Scenario 2, as illustrated in the above diagram. BGP peer R1 in an external network is configured on router R0.
Configuring EBGP with a Route Map
This example procedure configures a route map to modify all routes arriving from router R1 so that the next hop is changed to the IP address of the gateway for router R0. This gateway is always directly reachable from R0 and then autonomously forwards data traffic to router R1.
Step 1. Introduce a Route Map
Introduce a route map to modify routes arriving from R1 so that the next hop is set to the gateway of R0.
- Go to CONFIGURATION > Configuration Tree > Box > Assigned Services > OSPF-RIP-BGP-Service > OSPF/RIP/BGP Settings.
- From the Configuration menu in the left navigation pane, click Filter Setup IPv4.
- Click Lock.
- In the Route Maps IPv4 table, click + to add an entry for the route map.
- Enter a Name for the route map and then click OK.
- In the BGP Specific Conditions table, click + to add an entry for the BGP settings.
- In the Route Map Entry window, specify the following settings and then click OK:
- Sequence Number – Enter a unique number for the route map entry.
- Type – Select permit.
- Match Condition – Select None to specify that all routes must be modified.
- Set Action – Select Next_Hop.
- Set Next-Hop IP – Enter
10.0.0.1
, the gateway address.
- In the Route Maps window, click OK.
- Click Send Changes and Activate.
Step 2. Configure Neighbor Settings
Configure EBGP in the neighbor settings for R1.
- On the OSPF/RIP/BGP Settings page, click Neighbor Setup IPv4 from the Configuration menu in the left navigation pane.
- Click Lock.
- In the Neighbors table, click + to add an entry for the neighbor settings.
- Enter a name for the neighbor settings and then click OK.
- In the Usage and IP section of the Neighbors window, specify the following settings:
- Neighbor IPv4 – Enter
10.1.0.2.
- BGP Routing Protocol Usage – Select yes.
- Neighbor IPv4 – Enter
- In the BGP Parameters section, specify the following settings:
- AS Number – Enter
200.
- Update Source – Select Address.
- Update Source IPv4 Address – Enter
10.0.0.2
.
- AS Number – Enter
- To add a new route map, click Set next to Peer Filtering For Inputs.
- In the EBGP MultiHop field, you can specify the maximum allowed next hop distance to the neighbor. For example,
20
. - After you specify all of the required settings in the Neighbors window, click OK.
- Click Send Changes and Activate.
Configuring EBGP with Static Routes
This example procedure configures the neighbor settings for router R1 and introduces two routes:
- A static route over the gateway of router R0 to the network of router R1.
- A direct route to the network of router R1.
Step 1. Configure Neighbor Settings
Configure EBGP in the neighbor settings for R1.
Go to CONFIGURATION > Configuration Tree > Box > Assigned Services > OSPF-RIP-BGP-Service > OSPF/RIP/BGP Settings.
- From the Configuration menu in the left navigation pane, click Neighbor Setup IPv4.
- Click Lock.
- In the Neighbors table, click + to add an entry for the neighbor settings.
- Enter a name for the neighbor settings and then click OK.
- In the Usage and IP section of the Neighbors window, specify the following settings:
- Neighbor IPv4 – Enter
10.1.0.2.
- BGP Routing Protocol Usage – Select yes.
- Neighbor IPv4 – Enter
- In the BGP Parameters section, specify the following settings:
- AS Number – Enter
200
. - Update Source – Select Address.
- Update Source IPv4 Address – Enter
10.0.0.2
.
- AS Number – Enter
- In the EBGP MultiHop field, you can specify the maximum allowed next hop distance to the neighbor. For example,
20
. - After you specify all of the required settings in the Neighbors window, click OK.
- Click Send Changes and Activate.
Step 2. Execute a Next Hop Lookup
Assuming that a route arrives at 192.168.0.0/24 with the next hop 10.1.0.2, execute a next hop lookup for R1 (10.1.0.2). The lookup should provide the IP address of the gateway for R0 (10.0.0.1) and the interface port1.
Step 3. Configure a Static Route
Introduce a static route over the gateway of R0 to the network of R1. Use the following settings:
- Target Network Address –
10.1.0.2/32
- Route Type – gateway
- Gateway –
10.0.0.1
For more information, see How to Configure Gateway Routes.
Step 4. Configure a Device Route
To introduce the route that was learned over BGP, you must configure a direct route with the following settings:
- Target Network Address –
10.1.0.2/32
- Route Type – directly attached network
- Interface Name – port1
For more information, see How to Configure Directly Attached Routes.