|
| 1 | +--- |
| 2 | +title: Disable the Border Gateway Protocol neighbors |
| 3 | +description: Learn how to use read write commands in the Nexus Network Fabric to disable the Border Gateway Protocol. |
| 4 | +author: HollyCl |
| 5 | +ms.author: HollyCl |
| 6 | +ms.service: azure-operator-nexus |
| 7 | +ms.topic: concept-article |
| 8 | +ms.date: 05/03/2024 |
| 9 | +#CustomerIntent: As a <type of user>, I want <what?> so that <why?>. |
| 10 | +--- |
| 11 | +# Disable the Border Gateway Protocol neighbors |
| 12 | + |
| 13 | +This article provides examples demonstrating how a user can implement the read write (RW) commands to disable Border Gateway Protocol (BGP) neighbors. |
| 14 | + |
| 15 | +## Shut down a specific peer at Virtual Routing and Forwarding (VRF) level |
| 16 | + |
| 17 | +The following shows a snapshot of the Network Fabric Device before making changes to the configuration using RW API: |
| 18 | + |
| 19 | + |
| 20 | +```azurecli |
| 21 | +sh ip bgp summary vrf gfab1-isd |
| 22 | +``` |
| 23 | + |
| 24 | +```Output |
| 25 | +BGP summary information for VRF gfab1-isd |
| 26 | +Router identifier 10.XXX.14.34, local AS number 650XX |
| 27 | +Neighbor Status Codes: m - Under maintenance |
| 28 | + Neighbor V AS MsgRcvd MsgSent InQ OutQ Up/Down State PfxRcd PfxAcc |
| 29 | + 10.XXX.13.15 4 650XX 129458 168981 0 0 00:06:50 Estab 189 189 |
| 30 | + **10.XXX.30.18 4 650XX 42220 42522 0 0 00:00:44 Estab 154 154** |
| 31 | + 10.XXX.157.8 4 645XX 69211 74503 0 0 21d20h Estab 4 4 |
| 32 | + fda0:XXXX:XXXX:d::f 4 650XX 132192 171982 0 0 28d18h Estab 0 0 |
| 33 | +``` |
| 34 | + |
| 35 | +Execute the following command to disable the BGP neighbor: |
| 36 | + |
| 37 | +```azurecli |
| 38 | +az networkfabric device run-rw --resource-name <ResourceName> --resource-group <ResourceGroupName> --rw-command "router bgp 65055\n vrf gfab1-isd\n neighbor 10.100.30.18 shutdown" |
| 39 | +``` |
| 40 | + |
| 41 | +Expected output: |
| 42 | + |
| 43 | +```azurecli |
| 44 | +{} |
| 45 | +``` |
| 46 | + |
| 47 | +```bash |
| 48 | +sh ip bgp summary vrf gfab1-isd |
| 49 | +``` |
| 50 | + |
| 51 | +```Output |
| 52 | +BGP summary information for VRF gfab1-isd |
| 53 | +Router identifier 10.XXX.14.34, local AS number 650XX |
| 54 | +Neighbor Status Codes: m - Under maintenance |
| 55 | + Neighbor V AS MsgRcvd MsgSent InQ OutQ Up/Down State PfxRcd PfxAcc |
| 56 | + 10.XXX.13.15 4 650XX 129456 168975 0 0 00:04:31 Estab 189 189 |
| 57 | + **10.XXX.30.18 4 650XX 42210 42505 0 0 00:01:50 Idle(Admin)** |
| 58 | + 10.XXX.157.8 4 645XX 69206 74494 0 0 21d20h Estab 4 4 |
| 59 | + fda0:d59c:df06:d::f 4 65055 132189 171976 0 0 28d18h Estab 0 0 |
| 60 | +``` |
| 61 | + |
| 62 | +```azurecli |
| 63 | +Apr XX XXX:54 AR Bgp: %BGP-3-NOTIFICATION: sent to neighbor 10.XXX.30.18 (VRF gfab1-isd AS 650XX) 6/2 (Cease/administrative shutdown <Hard Reset>) reason: |
| 64 | +Apr XX XXX:54 AR Bgp: %BGP-3-NOTIFICATION: sent to neighbor 10.XXX.30.18 (VRF gfab1-isd AS 650XX) 6/5 (Cease/connection rejected) 0 bytes |
| 65 | +``` |
| 66 | + |
| 67 | +Command with `--no-wait` `--debug` |
| 68 | + |
| 69 | +```azurecli |
| 70 | +az networkfabric device run-rw --resource-name <ResourceName> --resource-group <ResourceGroupName> --rw-command "router bgp 65055\n vrf gfab1-isd\n neighbor 10.100.30.18 shutdown" --no-wait –debug |
| 71 | +``` |
| 72 | + |
| 73 | +| Parameter | Description | |
| 74 | +|--------------------------|-------------------------------------------------------------------------------------------------------------------------------| |
| 75 | +| `az networkfabric device run-rw` | Azure CLI command for executing a read-write operation on a network device within Azure Network Fabric. | |
| 76 | +| `--resource-name` | Specifies the name of the resource (network device) on which the RW operation will be performed. | |
| 77 | +| `--resource-group` | Specifies the name of the resource group that contains the network device. | |
| 78 | +| `--rw-command "router bgp 65055\n vrf gfab1-isd\n neighbor 10.100.30.18 shutdown"` | Specifies the RW commands to be executed on the network device. These commands configure BGP settings and shut down a specific neighbor. | |
| 79 | +| `--no-wait` | Indicates that the command should be executed asynchronously without waiting for the operation to complete. | |
| 80 | +| `--debug` | Flag enabling debug mode, providing additional information about the execution of the command for troubleshooting purposes. | |
| 81 | + |
| 82 | + |
| 83 | +Expected output: |
| 84 | + |
| 85 | +```Truncated output |
| 86 | +cli.knack.cli: Command arguments: \['networkfabric', 'device', 'run-rw', '--resource-name', <ResourceName>, '--resource-group', <ResourceGroupName>, '--rw-command', 'router bgp 65055\\\\n vrf gfab1-isd\\\\n neighbor 10.100.30.18 shutdown', '--debug'\] |
| 87 | +cli.knack.cli: \_\_init\_\_ debug log: |
| 88 | +Enable color in terminal. |
| 89 | +cli.knack.cli: Event: Cli.PreExecute \[\] |
| 90 | +cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate \[<function CLILogging.on\_global\_arguments at 0x01F1A610>;, <function OutputProducer.on\_global\_arguments at 0x0211B850>, <function CLIQuery.on\_global\_arguments at 0x021314A8>\] |
| 91 | +cli.azure.cli.core.sdk.policies: 'Azure-AsyncOperation': 'https://eastus.management.azure.com/subscriptionsXXXXXXXXXXXXXXXXXX/providers/Microsoft.ManagedNetworkFabric/locations/EASTUS/operationStatuses/e239299a-8c71-426e-8460-58d4c0b470e2\*850DA565ABE0036AB?api-version=2022-01-15-privatepreview&t=638479088323069839&c= |
| 92 | +``` |
| 93 | + |
| 94 | +You can programmatically check the status of the operation by running the following command: |
| 95 | + |
| 96 | +```azurecli |
| 97 | +az rest -m get -u "<Azure-AsyncOperation-endpoint url>" |
| 98 | +``` |
| 99 | + |
| 100 | +Example of the Azure-AsyncOperation endpoint URL extracted from the truncated output. |
| 101 | + |
| 102 | +```Endpoint URL |
| 103 | +<https://eastus.management.azure.com/subscriptions/xxxxxxxxxxx/providers/Microsoft.ManagedNetworkFabric/locations/EASTUS/operationStatuses/xxxxxxxxxxx?api-version=20XX-0X-xx-xx> |
| 104 | +``` |
| 105 | + |
| 106 | +The status indicates whether the API succeeded or failed. |
| 107 | + |
| 108 | +Expected output: |
| 109 | + |
| 110 | +```azurecli |
| 111 | +https://eastus.management.azure.com/subscriptions/XXXXXXXX/providers/Microsoft.ManagedNetworkFabric/locations/EASTUS/operationStatuses/e239299a-8c71-426e-8460-58d4c0b470e2AB?api-version=2022-01-15-privatepreview |
| 112 | +
|
| 113 | +{ |
| 114 | +
|
| 115 | +"endTime": "2024-XX-XXT10:14:13.2334379Z", |
| 116 | +"id": "/subscriptions/XXXXXXXXXXXXXX/providers/Microsoft.ManagedNetworkFabric/locations/EASTUS/operationStatuses/e239299a-8c71-426e-DA565ABE0036AB", |
| 117 | +"name": "e239299a-8c71-426e-8460-58d4c0b470e2\*E98FEC8C2D6479A6C0A450CE6E20DA4C9DDBF225A07F7F4850DA565ABE0036AB", |
| 118 | +"properties": null, |
| 119 | +"resourceId": "/subscriptions/XXXXXXXXXXXX/resourceGroups/ResourceGroup/providers/Microsoft.ManagedNetworkFabric/networkDevices/ResourceName", |
| 120 | +"startTime": "2024-XX-XXT10:13:52.0438351Z", |
| 121 | +"status": "Succeeded" |
| 122 | +} |
| 123 | +``` |
| 124 | + |
| 125 | +## Shut down the peer group at VRF level |
| 126 | + |
| 127 | +This example shows how the RW configuration is shuts down the peer group at a VRF level. |
| 128 | + |
| 129 | +```bash |
| 130 | +sh ip bgp summary vrf gfab1-isd |
| 131 | +``` |
| 132 | + |
| 133 | +```Output |
| 134 | +BGP summary information for VRF gfab1-isd |
| 135 | +Router identifier 10.XXX.14.34, local AS number 650XX |
| 136 | +Neighbor Status Codes: m - Under maintenance |
| 137 | + Neighbor V AS MsgRcvd MsgSent InQ OutQ Up/Down State PfxRcd PfxAcc |
| 138 | + 10.XXX.13.15 4 650XX 129458 168981 0 0 00:06:50 Estab 189 189 |
| 139 | + 10.XXX.30.18 4 650XX 42220 42522 0 0 00:00:44 Estab 154 154 |
| 140 | +** 10.XXX.157.8 4 645XX 69211 74503 0 0 21d20h Estab 4 4** |
| 141 | + fda0:XXXX:XXXX:d::f 4 650XX 132192 171982 0 0 28d18h Estab 0 0 |
| 142 | +``` |
| 143 | + |
| 144 | +```azurecli |
| 145 | +az networkfabric device run-rw --resource-name <ResourceName>; --resource-group <ResourceGroupName> --rw-command "router bgp 65055\\n neighbor untrustnetwork shutdown" |
| 146 | +``` |
| 147 | + |
| 148 | +| Parameter | Description | |
| 149 | +|--------------------------|-------------------------------------------------------------------------------------------------------------------------------| |
| 150 | +| `az networkfabric device run-rw` | Azure CLI command for executing a read-write operation on a network device within Azure Network Fabric. | |
| 151 | +| `--resource-name` | Specifies the name of the resource (network device) on which the RW operation is performed. | |
| 152 | +| `--resource-group` | Specifies the name of the resource group that contains the network device. | |
| 153 | +| `--rw-command "router bgp 65055\n neighbor untrustnetwork shutdown"` | Specifies the RW commands to be executed on the network device. These commands configure BGP settings to shut down the neighbor named "untrustnetwork". | |
| 154 | + |
| 155 | +Expected output: |
| 156 | + |
| 157 | +```azurecli |
| 158 | +{} |
| 159 | +``` |
| 160 | + |
| 161 | +```bash |
| 162 | +sh ip bgp summary vrf gfab1-isd |
| 163 | +``` |
| 164 | + |
| 165 | +```Output |
| 166 | +BGP summary information for VRF gfab1-isd |
| 167 | +Router identifier 10.XXX.14.34, |
| 168 | +Neighbor V AS MsgRcvd MsgSent InQ OutQ Up/Down State PfxRcd PfxAcc |
| 169 | + 10.XXX.13.15 4 65055 129462 168986 0 0 00:10:10 Estab 189 189 |
| 170 | + 10.XXX.30.18 4 65055 42224 42527 0 0 00:04:04 Estab 154 154 |
| 171 | + fda0:XXX:XXXX:d::f 4 65055 132196 171987 0 0 28d18h Estab 0 0 |
| 172 | +``` |
| 173 | + |
| 174 | +```azurecli |
| 175 | +AR-CE1)#Apr X XX-XX:09 AR-CE1 Bgp: %BGP-3-NOTIFICATION: sent to neighbor **10.XXX.157.8** (VRF gfab1-isd AS 64512) 6/2 (Cease/administrative shutdown <Hard Reset>) reason: |
| 176 | +
|
| 177 | +Apr 8 13:24:11 AR-CE1 Bgp: %BGP-3-NOTIFICATION: sent to neighbor **10.XXX.157.8** (VRF gfab1-isd AS 64512) 6/5 (Cease/connection rejected) 0 bytes |
| 178 | +``` |
| 179 | + |
| 180 | +Command with `--no-wait` `--debug` |
| 181 | + |
| 182 | +```azurecli |
| 183 | +az networkfabric device run-rw --resource-name <ResourceName> --resource-group <ResourceGroupName> --rw-command "router bgp 65055\n neighbor untrustnetwork shutdown" --no-wait --debug |
| 184 | +``` |
| 185 | + |
| 186 | +| Parameter | Description | |
| 187 | +|--------------------------|-------------------------------------------------------------------------------------------------------------------------------| |
| 188 | +| `az networkfabric device run-rw` | Azure CLI command for executing a read-write operation on a network device within Azure Network Fabric. | |
| 189 | +| `--resource-name` | Specifies the name of the resource (network device) on which the RW operation is performed. | |
| 190 | +| `--resource-group` | Specifies the name of the resource group that contains the network device. | |
| 191 | +| `--rw-command "router bgp 65055\n neighbor untrustnetwork shutdown"` | Specifies the RW commands to be executed on the network device. These commands configure BGP settings to shut down the neighbor named "untrustnetwork". | |
| 192 | +| `--no-wait` | Indicates that the command should be executed asynchronously without waiting for the operation to complete. | |
| 193 | +| `--debug` | Flag enabling debug mode, providing additional information about the execution of the command for troubleshooting purposes. | |
| 194 | + |
| 195 | + |
| 196 | +Expected truncated output: |
| 197 | + |
| 198 | +```Truncated output |
| 199 | +cli.knack.cli: Command arguments: ['networkfabric', 'device', 'run-rw', '--resource-name', <ResourceName>, '--resource-group', <ResourceGroup>, '--rw-command', 'router bgp 65055\\n neighbor untrustnetwork shutdown', '--debug'] |
| 200 | +cli.knack.cli: __init__ debug log: |
| 201 | +Enable color in terminal. |
| 202 | +cli.knack.cli: Event: Cli.PreExecute [] |
| 203 | +cli.azure.cli.core.sdk.policies: 'Expires': '-1' |
| 204 | +cli.azure.cli.core.sdk.policies: 'Location': 'https://eastus2euap.management.azure.com/subscriptions/XXXXXXXXXX/providers/Microsoft.ManagedNetworkFabric/locations/EASTUS/operationStatuses/4659700f-0280-491d-b478-491c6a88628c*F348648BDC06F42B2EDBC6E58?api-version=2022-01-15-privatepreview&t=638481804853087320 |
| 205 | +telemetry.process: Return from creating process |
| 206 | +telemetry.main: Finish creating telemetry upload process. |
| 207 | +``` |
| 208 | + |
| 209 | +You can programmatically check the status of the operation by running the following command: |
| 210 | + |
| 211 | +```azurecli |
| 212 | +az rest -m get -u "<Azure-AsyncOperation-endpoint url>" |
| 213 | +``` |
| 214 | + |
| 215 | +Example of the Azure-AsyncOperation endpoint URL extracted from the truncated output. |
| 216 | + |
| 217 | +```Endpoint URL |
| 218 | +<https://eastus.management.azure.com/subscriptions/xxxxxxxxxxx/providers/Microsoft.ManagedNetworkFabric/locations/EASTUS/operationStatuses/xxxxxxxxxxx?api-version=20XX-0X-xx-xx> |
| 219 | +``` |
| 220 | +The status indicates whether the API succeeded or failed. |
| 221 | + |
| 222 | +Expected output: |
| 223 | + |
| 224 | +```azurecli |
| 225 | +https://eastus.management.azure.com/subscriptions/XXXXXXXX/providers/Microsoft.ManagedNetworkFabric/locations/EASTUS/operationStatuses/e239299a-8c71-426e-8460-58d4c0b470e2AB?api-version=2022-01-15-privatepreview |
| 226 | +
|
| 227 | +{ |
| 228 | +
|
| 229 | +"endTime": "2024-XX-XXT10:14:13.2334379Z", |
| 230 | +"id": "/subscriptions/XXXXXXXXXXXXXX/providers/Microsoft.ManagedNetworkFabric/locations/EASTUS/operationStatuses/e239299a-8c71-426e-DA565ABE0036AB", |
| 231 | +"name": "e239299a-8c71-426e-8460-58d4c0b470e2\*E98FEC8C2D6479A6C0A450CE6E20DA4C9DDBF225A07F7F4850DA565ABE0036AB", |
| 232 | +"properties": null, |
| 233 | +"resourceId": "/subscriptions/XXXXXXXXXXXX/resourceGroups/ResourceGroup/providers/Microsoft.ManagedNetworkFabric/networkDevices/ResourceName", |
| 234 | +"startTime": "2024-XX-XXT10:13:52.0438351Z", |
| 235 | +"status": "Succeeded" |
| 236 | +} |
| 237 | +``` |
| 238 | + |
| 239 | +## Incorrect configuration operation |
| 240 | + |
| 241 | +If you try to implement a configuration command on the device and the configuration is incorrect, the configuration isn't enforced on the device. The prompt yields a typical error response, indicating a gNMI SET failure. To rectify this error, reapply the correct configuration. There's no change to the state of the device. |
| 242 | + |
| 243 | +```azurecli |
| 244 | +az networkfabric device run-rw --resource-name <ResourceName> --resource-group <ResourceGroupName> --rw-command "router bgp 4444\n vrf gfab1-isd\n niehgbor 10.100.30.18 shudown" |
| 245 | +``` |
| 246 | + |
| 247 | +| Parameter | Description | |
| 248 | +|--------------------------|-------------------------------------------------------------------------------------------------------------------------------| |
| 249 | +| `az networkfabric device run-rw` | Azure CLI command for executing a read-write operation on a network device within Azure Network Fabric. | |
| 250 | +| `--resource-name` | Specifies the name of the resource (network device) on which the RW operation is performed. | |
| 251 | +| `--resource-group` | Specifies the name of the resource group that contains the network device. | |
| 252 | +| `--rw-command "router bgp 4444\n vrf gfab1-isd\n niehgbor 10.100.30.18 shudown"` | Specifies the RW commands to be executed on the network device. These commands configure BGP settings to shut down the neighbor with IP address 10.100.30.18 within the VRF named "gfab1-isd". | |
| 253 | + |
| 254 | + |
| 255 | +Expected output: |
| 256 | + |
| 257 | +```Output |
| 258 | +Error: Message: \[GNMI SET failed. Error: GNMI SET failed: rpc error: code = config failed to apply. |
| 259 | +``` |
| 260 | + |
| 261 | +## Related content |
| 262 | + |
| 263 | +- [Run read write commands](concepts-network-fabric-read-write-commands.md) |
0 commit comments