You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/vpn-gateway/packet-capture.md
+46-35Lines changed: 46 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn about packet capture functionality that you can use on VPN ga
5
5
author: cherylmc
6
6
ms.service: vpn-gateway
7
7
ms.topic: how-to
8
-
ms.date: 01/31/2022
8
+
ms.date: 08/24/2023
9
9
ms.author: cherylmc
10
10
---
11
11
@@ -15,9 +15,9 @@ Connectivity and performance-related problems are often complex. It can take sig
15
15
16
16
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.
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.
21
21
22
22
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.
23
23
@@ -32,7 +32,8 @@ The following examples of JSON and a JSON schema provide explanations of each pr
32
32
> [!NOTE]
33
33
> Set the **CaptureSingleDirectionTrafficOnly** option to **false** if you want to capture both inner and outer packets.
34
34
35
-
### Example JSON
35
+
**Example JSON**
36
+
36
37
```JSON-interactive
37
38
{
38
39
"TracingFlags": 11,
@@ -61,7 +62,9 @@ The following examples of JSON and a JSON schema provide explanations of each pr
61
62
]
62
63
}
63
64
```
64
-
### JSON schema
65
+
66
+
**JSON schema**
67
+
65
68
```JSON-interactive
66
69
{
67
70
"type": "object",
@@ -316,40 +319,60 @@ The following examples of JSON and a JSON schema provide explanations of each pr
316
319
}
317
320
```
318
321
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
320
333
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.
322
335
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.
325
339
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**.
327
343
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":::
329
345
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**.
331
348
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 packetcapture - portal
333
350
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.
335
352
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.
337
358
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":::
339
360
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.
341
362
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.
343
366
344
367
## Packet capture - PowerShell
345
368
346
369
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).
347
370
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).
350
374
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).
For more information on parameter options, see [Stop-AzVirtualNetworkGatewayConnectionPacketCapture](/powershell/module/az.network/stop-azvirtualnetworkgatewayconnectionpacketcapture).
385
408
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
-
398
409
## Next steps
399
410
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