|
| 1 | +--- |
| 2 | +title: How to configure BGP prefix limit on Customer Edge (CE) devices for Azure Operator Nexus |
| 3 | +description: Learn the process for configuring BGP prefix limit on Customer Edge (CE) devices for Azure Operator Nexus |
| 4 | +author: sushantjrao |
| 5 | +ms.author: sushrao |
| 6 | +ms.date: 04/02/2025 |
| 7 | +ms.topic: how-to |
| 8 | +ms.service: azure-operator-nexus |
| 9 | +ms.custom: template-how-to, devx-track-azurecli |
| 10 | +--- |
| 11 | + |
| 12 | +# BGP prefix limiting overview |
| 13 | + |
| 14 | +BGP (Border Gateway Protocol) prefix limiting is an essential overload protection mechanism for Customer Edge (CE) devices. It helps prevent the Nexus fabric from being overwhelmed when a Nexus tenant advertises an excessive number of BGP routes into a Nexus Virtual Routing and Forwarding (VRF) instance. This feature ensures network stability and security by controlling the number of prefixes received from BGP peers. |
| 15 | + |
| 16 | +## Configuration of BGP prefix limits |
| 17 | + |
| 18 | +BGP prefix limits can be configured using two primary parameters: |
| 19 | + |
| 20 | +- **max-routes (hard limits)**: This parameter sets the maximum number of prefixes a BGP router accepts from a neighbor. If the limit is exceeded, the BGP session with that neighbor is terminated to prevent overloading the router. |
| 21 | + |
| 22 | +- **warn-threshold (soft limits)**: The warn-threshold parameter sets a warning threshold below the max-routes limit. When the number of prefixes received from a neighbor exceeds this threshold, a warning is generated, but the BGP session isn't terminated. This policy allows network administrators to take corrective action before the hard limit is reached. |
| 23 | + |
| 24 | +### Hard limits (max-routes) |
| 25 | + |
| 26 | +The `max-routes` parameter specifies the maximum number of prefixes that a BGP router can accept from a neighbor. If the number exceeds this limit, the BGP session with that neighbor is terminated. This threshold is a "hard" limit to protect the router from excessive load and to maintain network stability. |
| 27 | + |
| 28 | +### Soft limits (warn-threshold) |
| 29 | + |
| 30 | +The `warn-threshold` parameter is a "soft" limit. When the number of prefixes exceeds this threshold, a warning is triggered, but the BGP session remains active. This safeguard serves as a precautionary measure, allowing administrators to intervene before reaching the hard limit. |
| 31 | + |
| 32 | +To configure **BGP Prefix Limit** on **Customer Edge (CE)** devices for **Azure Operator Nexus**, follow the steps below. This configuration includes setting the prefix limits for BGP sessions to manage network stability and prevent the Nexus fabric from being overwhelmed when a tenant advertises excessive BGP routes. |
| 33 | + |
| 34 | + |
| 35 | +### Prerequisites |
| 36 | + |
| 37 | +- Ensure that the **Network Fabric (NF)** is upgraded to the supported version or later. |
| 38 | + |
| 39 | +- Verify that your **Customer Edge (CE)** devices are running on compatible software. |
| 40 | + |
| 41 | +- Check that the **peer groups** for both **IPv4** and **IPv6** address-families are properly set up for internal networks. |
| 42 | + |
| 43 | +### Steps to configure BGP prefix limits |
| 44 | + |
| 45 | +#### Step 1: Define BGP prefix limits |
| 46 | + |
| 47 | +You need to configure the BGP prefix limits using the parameters `maximumRoutes` and `threshold`. |
| 48 | + |
| 49 | +- **`maximumRoutes`**: This parameter defines the maximum number of BGP prefixes the router accepts from a BGP peer. |
| 50 | + |
| 51 | +- **`threshold`**: This parameter defines the warning threshold as a percentage of the `maximumRoutes`. When the number of prefixes exceeds this threshold, a warning is generated. |
| 52 | + |
| 53 | +#### Step 2: Configure on the CE device |
| 54 | + |
| 55 | +##### Example 1: BGP Prefix Limit with automatic restart |
| 56 | + |
| 57 | +This configuration will automatically restart the session after a defined idle time when the prefix limit is exceeded. |
| 58 | + |
| 59 | +```json |
| 60 | +{ |
| 61 | + "prefixLimits": { |
| 62 | + "maximumRoutes": 5000, |
| 63 | + "threshold": 80, |
| 64 | + "idleTimeExpiry": 100 |
| 65 | + } |
| 66 | +} |
| 67 | +``` |
| 68 | + |
| 69 | +- **Explanation**: |
| 70 | + |
| 71 | + - **maximumRoutes**: 5,000 routes are the limit for the BGP session. |
| 72 | + |
| 73 | + - **threshold**: A warning is triggered when the prefix count reaches 80% (4,000 routes). |
| 74 | + |
| 75 | + - **idleTimeExpiry**: If the session is shut down, it will restart automatically after 100 seconds of idle time. |
| 76 | + |
| 77 | +##### Example 2: BGP prefix limit without automatic restart |
| 78 | + |
| 79 | +This configuration shuts down the session when the maximum prefix limit is reached, but manual intervention is required to restart the session. |
| 80 | + |
| 81 | +```json |
| 82 | +{ |
| 83 | + "prefixLimits": { |
| 84 | + "maximumRoutes": 5000, |
| 85 | + "threshold": 80 |
| 86 | + } |
| 87 | +} |
| 88 | +``` |
| 89 | + |
| 90 | +- **Explanation**: |
| 91 | + |
| 92 | + - **maximumRoutes**: 5,000 routes are the limit for the BGP session. |
| 93 | + |
| 94 | + - **threshold**: A warning is triggered when the prefix count reaches 80% (4,000 routes). |
| 95 | + |
| 96 | + - No automatic restart; manual intervention is required to restart the session. |
| 97 | + |
| 98 | +##### Example 3: Hard-Limit drop BGP sessions |
| 99 | + |
| 100 | +This configuration drops extra routes if the prefix limit is exceeded without maintaining a cache of the dropped routes. |
| 101 | + |
| 102 | +```json |
| 103 | +{ |
| 104 | + "prefixLimits": { |
| 105 | + "maximumRoutes": 5000 |
| 106 | + } |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +- **Explanation**: |
| 111 | + |
| 112 | + - **maximumRoutes**: 5,000 routes are the limit for the BGP session. |
| 113 | + |
| 114 | + - Once the limit is reached, the CE device drops any extra prefixes received from the BGP peer. |
| 115 | + |
| 116 | +##### Example 4: Hard-Limit warning only |
| 117 | + |
| 118 | +This configuration generates a warning once the prefix count reaches a certain percentage of the maximum limit but does not shut down the session. |
| 119 | + |
| 120 | +```json |
| 121 | +{ |
| 122 | + "prefixLimits": { |
| 123 | + "maximumRoutes": 8000, |
| 124 | + "threshold": 75, |
| 125 | + "warning-only": true |
| 126 | + } |
| 127 | +} |
| 128 | +``` |
| 129 | + |
| 130 | +- **Explanation**: |
| 131 | + |
| 132 | + - **maximumRoutes**: 8,000 routes are the limit for the BGP session. |
| 133 | + |
| 134 | + - **threshold**: A warning is generated when the prefix count reaches 75% (6,000 routes). |
| 135 | + |
| 136 | + - The session isn't shut down. This configuration is used to only generate a warning without taking any session-terminating action. |
| 137 | + |
| 138 | +#### Step 3: Apply Configuration Using Azure CLI |
| 139 | + |
| 140 | +You can use Azure CLI commands to apply the BGP prefix limits to the external network configuration for Nexus. |
| 141 | + |
| 142 | +- **With Automatic Restart**: |
| 143 | + |
| 144 | + ```bash |
| 145 | + az networkfabric externalnetwork create --resource-group <resource-group> --fabric-name <fabric-name> --network-name <network-name> --prefix-limits '{"maximumRoutes": 5000, "threshold": 80, "idleTimeExpiry": 100}' |
| 146 | + ``` |
| 147 | + |
| 148 | +- **Without Automatic Restart**: |
| 149 | + |
| 150 | + ```bash |
| 151 | + az networkfabric externalnetwork create --resource-group <resource-group> --fabric-name <fabric-name> --network-name <network-name> --prefix-limits '{"maximumRoutes": 5000, "threshold": 80}' |
| 152 | + ``` |
| 153 | + |
| 154 | +- **Hard-Limit Drop BGP Sessions**: |
| 155 | + |
| 156 | + ```bash |
| 157 | + az networkfabric externalnetwork create --resource-group <resource-group> --fabric-name <fabric-name> --network-name <network-name> --prefix-limits '{"maximumRoutes": 5000}' |
| 158 | + ``` |
| 159 | + |
| 160 | +- **Hard-Limit Warning Only**: |
| 161 | + |
| 162 | + ```bash |
| 163 | + az networkfabric externalnetwork create --resource-group <resource-group> --fabric-name <fabric-name> --network-name <network-name> --prefix-limits '{"maximumRoutes": 8000, "threshold": 75, "warning-only": true}' |
| 164 | + ``` |
| 165 | + |
| 166 | +#### Step 4: Monitor and validate the configuration |
| 167 | + |
| 168 | +After applying the configuration, ensure to monitor the **BGP session** and validate whether the prefix limits are being enforced properly. You can check the status of the BGP session by using the following command: |
| 169 | + |
| 170 | +```bash |
| 171 | +show ip bgp summary |
| 172 | +``` |
| 173 | + |
| 174 | +Look for the session states and the number of prefixes advertised by each peer. If the limits are being hit, you should see the session state change to **Established** or **Idle** based on the configuration. |
| 175 | + |
| 176 | +### Considerations |
| 177 | + |
| 178 | +- **Threshold and Maximum Limits**: Ensure that you set appropriate thresholds to avoid unnecessary session terminations while still protecting the network from overload. |
| 179 | + |
| 180 | +- **Automatic vs. Manual Restart**: Depending on your network operations, choose between automatic and manual restart options. Automatic restart is useful for minimizing manual intervention, but manual restart may give network administrators more control over recovery. |
| 181 | + |
| 182 | +## Handling BGP Prefix Limits for Different Networks |
| 183 | + |
| 184 | +### Internal network |
| 185 | + |
| 186 | +The platform supports Layer 3 Isolation Domain (L3IsolationDomain) for tenant workloads. It performs device programming on Nexus instances and Arista devices with peer groups for both IPv4 and IPv6 address families. |
| 187 | + |
| 188 | +### External network Option B (PE) |
| 189 | + |
| 190 | +For external network configuration, only the **hard-limit warning-only** option is supported. Nexus supports this configuration via the ARM API under the **NNI optionBlayer3Configuration** with the `maximumRoutes` parameter. |
| 191 | + |
| 192 | +### NNI Option A |
| 193 | + |
| 194 | +For NNI Option A, only a single peer group is allowed. IPv4 over IPv6 and vice versa aren't supported. Warning-only mode is available for handling prefix limits. |
| 195 | + |
| 196 | +By following this guide, you can configure BGP prefix limits effectively to protect your network from overload and ensure that BGP sessions are properly managed for both internal and external networks. |
0 commit comments