Skip to content

Commit 941ed52

Browse files
authored
Merge pull request #249245 from cherylmc/packet-capture2
freshness updates
2 parents ed72364 + 8a51d4d commit 941ed52

File tree

6 files changed

+46
-35
lines changed

6 files changed

+46
-35
lines changed
383 KB
Loading
423 KB
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.

articles/vpn-gateway/packet-capture.md

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn about packet capture functionality that you can use on VPN ga
55
author: cherylmc
66
ms.service: vpn-gateway
77
ms.topic: how-to
8-
ms.date: 01/31/2022
8+
ms.date: 08/24/2023
99
ms.author: cherylmc
1010
---
1111

@@ -15,9 +15,9 @@ Connectivity and performance-related problems are often complex. It can take sig
1515

1616
There are some commonly available packet capture tools. Getting relevant packet captures with these tools can be cumbersome, especially in high-volume traffic scenarios. The filtering capabilities provided by Azure VPN Gateway packet capture are a major differentiator. You can use VPN Gateway packet capture together with commonly available packet capture tools.
1717

18-
## VPN Gateway packet capture filtering capabilities
18+
## About packet capture for VPN Gateway
1919

20-
You can run VPN Gateway packet capture on the gateway or on a specific connection, depending on your needs. You can also run packet capture on multiple tunnels at the same time. You can capture one-way or bi-directional traffic, IKE and ESP traffic, and inner packets along with filtering on a VPN gateway.
20+
You can run VPN Gateway packet capture on the gateway, or on a specific connection, depending on your needs. You can also run packet capture on multiple tunnels at the same time. You can capture one-way or bi-directional traffic, IKE and ESP traffic, and inner packets along with filtering on a VPN gateway.
2121

2222
It's helpful to use a five-tuple filter (source subnet, destination subnet, source port, destination port, protocol) and TCP flags (SYN, ACK, FIN, URG, PSH, RST) when you're isolating problems in high-volume traffic.
2323

@@ -32,7 +32,8 @@ The following examples of JSON and a JSON schema provide explanations of each pr
3232
> [!NOTE]
3333
> Set the **CaptureSingleDirectionTrafficOnly** option to **false** if you want to capture both inner and outer packets.
3434
35-
### Example JSON
35+
**Example JSON**
36+
3637
```JSON-interactive
3738
{
3839
"TracingFlags": 11,
@@ -61,7 +62,9 @@ The following examples of JSON and a JSON schema provide explanations of each pr
6162
]
6263
}
6364
```
64-
### JSON schema
65+
66+
**JSON schema**
67+
6568
```JSON-interactive
6669
{
6770
"type": "object",
@@ -316,40 +319,60 @@ The following examples of JSON and a JSON schema provide explanations of each pr
316319
}
317320
```
318321

319-
## Start packet capture - portal
322+
### Key considerations
323+
324+
- Running packet capture can affect performance. Remember to stop the packet capture when you don't need it.
325+
- Suggested minimum packet capture duration is 600 seconds. Because of sync issues among multiple components on the path, shorter packet captures might not provide complete data.
326+
- Packet capture data files are generated in PCAP format. Use Wireshark or other commonly available applications to open PCAP files.
327+
- Packet captures aren't supported on policy-based gateways.
328+
- The maximum filesize of packet capture data files is 500 MB.
329+
- If the `SASurl` parameter isn't configured correctly, the trace might fail with Storage errors. For examples of how to correctly generate an `SASurl` parameter, see [Stop-AzVirtualNetworkGatewayPacketCapture](/powershell/module/az.network/stop-azvirtualnetworkgatewaypacketcapture).
330+
- If you're configuring a User Delegated SAS, make sure the user account is granted proper RBAC permissions on the storage account such as Storage Blob Data Owner.
331+
332+
## Packet capture - portal
320333

321-
You can set up packet capture in the Azure portal by navigating to the VPN Gateway Packet Capture blade in the Azure portal and clicking the **Start Packet Capture button**
334+
This section helps you start and stop a packet capture using the Azure portal.
322335

323-
> [!NOTE]
324-
> Do not select the **Capture Single Direction Traffic Only** option if you want to capture both inner and outer packets.
336+
### Start packet capture - portal
337+
338+
You can set up packet capture in the Azure portal.
325339

326-
:::image type="content" source="./media/packet-capture/portal.jpg" alt-text="Screenshot of start packet capture in the portal." lightbox="./media/packet-capture/portal.jpg":::
340+
1. Go to your VPN gateway in the Azure portal.
341+
1. On the left, select **VPN Gateway Packet Capture** to open the VPN Gateway Packet Capture page.
342+
1. Select **Start Packet Capture**.
327343

328-
## Stop packet capture - portal
344+
:::image type="content" source="./media/packet-capture/packet-capture-portal.png" alt-text="Screenshot of start packet capture in the portal." lightbox="./media/packet-capture/packet-capture-portal.png":::
329345

330-
A valid SAS (or Shared Access Signature) Uri with read/write access is required to complete a packet capture. When a packet capture is stopped, the output of the packet capture is written to the container that is referenced by the SAS Uri. To get the SAS Uri, navigate to the required storage account and generate a SAS token and URL with the correct permissions.
346+
1. On the **Start Packet Capture** page, make any necessary adjustments. Don't select the "Capture Single Direction Traffic Only" option if you want to capture both inner and outer packets.
347+
1. Once you've configured the settings, click **Start Packet Capture**.
331348

332-
:::image type="content" source="./media/packet-capture/sastoken.jpg" alt-text="Screenshot of SAS Uri Token." lightbox="./media/packet-capture/sastoken.jpg":::
349+
### Stop packet capture - portal
333350

334-
* Copy the Blob SAS URL as it will be needed in the next step.
351+
To complete a packet capture, you need to provide a valid SAS (or Shared Access Signature) URL with read/write access. When a packet capture is stopped, the output of the packet capture is written to the container that is referenced by the SAS URL.
335352

336-
* Navigate to the VPN Gateway Packet Capture blade in the Azure portal and clicking the **Stop Packet Capture** button
353+
1. To get the SAS URL, go to the storage account.
354+
1. Go to the container you want to use and right-click to show the dropdown list. Select **Generate SAS** to open the Generate SAS page.
355+
1. On the Generate SAS page, configure your settings. Make sure that you have granted read and write access.
356+
1. Click **Generate SAS token and URL**.
357+
1. The SAS token and SAS URL is generated and appears below the button immediately. Copy the Blob SAS URL.
337358

338-
* Paste the SAS URL (from the previous step) in the **Output Sas Uri** text box and click **Stop Packet Capture**.
359+
:::image type="content" source="./media/packet-capture/generate-sas.png" alt-text="Screenshot of generate SAS token." lightbox="./media/packet-capture/generate-sas.png":::
339360

340-
:::image type="content" source="./media/packet-capture/stopcapture.jpg" alt-text="Screenshot of stop packet capture in the portal." lightbox="./media/packet-capture/stopcapture.jpg":::
361+
1. Go back to the VPN Gateway Packet Capture page in the Azure portal and click the **Stop Packet Capture** button.
341362

342-
* The packet capture (pcap) file will be stored in the specified account
363+
1. Paste the SAS URL (from the previous step) in the **Output Sas Url** text box and click **Stop Packet Capture**.
364+
365+
1. The packet capture (pcap) file will be stored in the specified account.
343366

344367
## Packet capture - PowerShell
345368

346369
The following examples show PowerShell commands that start and stop packet captures. For more information on parameter options, see [Start-AzVirtualnetworkGatewayPacketCapture](/powershell/module/az.network/start-azvirtualnetworkgatewaypacketcapture).
347370

348-
>
349-
### Prerequisite
371+
**Prerequisites**
372+
373+
* Packet capture data needs to be logged into a storage account on your subscription. See [create storage account](../storage/common/storage-account-create.md).
350374

351-
* Packet capture data will need to be logged into a storage account on your subscription. See [create storage account](../storage/common/storage-account-create.md).
352-
* To stop the packet capture, you will need to generate the `SASUrl` for your storage account. See [create a user delegation SAS](../storage/blobs/storage-blob-user-delegation-sas-create-powershell.md).
375+
* To stop the packet capture, you'll need to generate the `SASUrl` for your storage account. See [create a user delegation SAS](../storage/blobs/storage-blob-user-delegation-sas-create-powershell.md).
353376

354377
### Start packet capture for a VPN gateway
355378

@@ -383,18 +406,6 @@ Stop-AzVirtualNetworkGatewayConnectionPacketCapture -ResourceGroupName "YourReso
383406

384407
For more information on parameter options, see [Stop-AzVirtualNetworkGatewayConnectionPacketCapture](/powershell/module/az.network/stop-azvirtualnetworkgatewayconnectionpacketcapture).
385408

386-
## Key considerations
387-
388-
- Running packet capture can affect performance. Remember to stop the packet capture when you don't need it.
389-
- Suggested minimum packet capture duration is 600 seconds. Because of sync issues among multiple components on the path, shorter packet captures might not provide complete data.
390-
- Packet capture data files are generated in PCAP format. Use Wireshark or other commonly available applications to open PCAP files.
391-
- Packet captures aren't supported on policy-based gateways.
392-
- The maximum filesize of packet capture data files is 500MB.
393-
- If the `SASurl` parameter isn't configured correctly, the trace might fail with Storage errors. For examples of how to correctly generate an `SASurl` parameter, see [Stop-AzVirtualNetworkGatewayPacketCapture](/powershell/module/az.network/stop-azvirtualnetworkgatewaypacketcapture).
394-
- If you are configuring a User Delegated SAS, make sure the user account is granted proper RBAC permissions on the storage account such as Storage Blob Data Owner.
395-
396-
397-
398409
## Next steps
399410

400-
For more information about VPN Gateway, see [What is VPN Gateway?](vpn-gateway-about-vpngateways.md).
411+
For more information about VPN Gateway, see [What is VPN Gateway?](vpn-gateway-about-vpngateways.md)

0 commit comments

Comments
 (0)