Skip to content

Commit 7b53cbb

Browse files
committed
freshness
1 parent 7e3595d commit 7b53cbb

File tree

4 files changed

+64
-51
lines changed

4 files changed

+64
-51
lines changed
76.6 KB
Loading
105 KB
Loading
102 KB
Loading

articles/network-watcher/network-watcher-packet-capture-manage-portal.md

Lines changed: 64 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,111 @@
11
---
2-
title: Manage packet captures - Azure portal
2+
title: Manage packet captures in VMs with Network Watcher - Azure portal
33
titleSuffix: Azure Network Watcher
44
description: Learn how to manage the packet capture feature of Network Watcher using the Azure portal.
55
services: network-watcher
6-
documentationcenter: na
76
author: shijaiswal
87
ms.service: network-watcher
98
ms.topic: how-to
10-
ms.tgt_pltfrm: na
119
ms.workload: infrastructure-services
12-
ms.date: 01/07/2021
10+
ms.date: 01/04/2023
1311
ms.author: shijaiswal
12+
ms.custom: template-how-to, engagement-fy23
1413
---
1514

16-
# Manage packet captures with Azure Network Watcher using the portal
15+
# Manage packet captures in virtual machines with Azure Network Watcher using the Azure portal
1716

1817
Network Watcher packet capture allows you to create capture sessions to track traffic to and from a virtual machine. Filters are provided for the capture session to ensure you capture only the traffic you want. Packet capture helps to diagnose network anomalies, both reactively, and proactively. Other uses include gathering network statistics, gaining information on network intrusions, to debug client-server communication, and much more. Being able to remotely trigger packet captures, eases the burden of running a packet capture manually on a desired virtual machine, which saves valuable time.
1918

2019
In this article, you learn to start, stop, download, and delete a packet capture.
2120

22-
## Before you begin
21+
## Prerequisites
2322

24-
Packet capture requires the following outbound TCP connectivity:
25-
- to the chosen storage account over port 443
26-
- to 169.254.169.254 over port 80
27-
- to 168.63.129.16 over port 8037
23+
- An Azure account with an active subscription. [Create one for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
24+
- Packet capture requires the following outbound TCP connectivity:
25+
- to the chosen storage account over port 443
26+
- to 169.254.169.254 over port 80
27+
- to 168.63.129.16 over port 8037
2828

2929
> [!NOTE]
3030
> The ports mentioned in the latter two cases above are common across all Network Watcher features that involve the Network Watcher extension and might occasionally change.
3131
32-
33-
If a network security group is associated to the network interface, or subnet that the network interface is in, ensure that rules exist that allow the previous ports. Similarly, adding user-defined traffic routes to your network may prevent connectivity to the above mentioned IPs and ports. Please ensure they are reachable.
32+
If a network security group is associated to the network interface, or subnet that the network interface is in, ensure that rules exist to allow outbound connectivity over the previous ports. Similarly, adding user-defined routes to your network may prevent connectivity to the above mentioned IPs and ports. Please ensure they are reachable.
3433

3534
## Start a packet capture
3635

37-
1. In your browser, navigate to the [Azure portal](https://portal.azure.com) and select **All services**, and then select **Network Watcher** in the **Networking section**.
38-
2. Select **Packet capture** under **Network diagnostic tools**. Any existing packet captures are listed, regardless of their status.
39-
3. Select **Add** to create a packet capture. You can select values for the following properties:
40-
- **Subscription**: The subscription that the virtual machine you want to create the packet capture for is in.
41-
- **Resource group**: The resource group of the virtual machine.
42-
- **Target virtual machine**: The virtual machine that you want to create the packet capture for.
43-
- **Packet capture name**: A name for the packet capture.
44-
- **Storage account or file**: Select **Storage account**, **File**, or both. If you select **File**, the capture is written to a path within the virtual machine.
45-
- **Local file path**: The local path on the virtual machine where the packet capture will be saved (valid only when *File* is selected). The path must be a valid path. If you are using a Linux virtual machine, the path must start with */var/captures*.
46-
- **Storage accounts**: Select an existing storage account, if you selected *Storage account*. This option is only available if you selected **Storage**.
47-
36+
1. Sign in to the [Azure portal](https://portal.azure.com).
37+
1. In the search box at the top of the portal, enter *Network Watcher*.
38+
1. In the search results, select **Network Watcher**.
39+
1. Select **Packet capture** under **Network diagnostic tools**. Any existing packet captures are listed, regardless of their status.
40+
1. Select **+ Add** to create a packet capture. In **Add packet capture**, enter or select values for the following settings:
41+
42+
| Setting | Value |
43+
| --- | --- |
44+
| **Basic Details** | |
45+
| Subscription | Select the Azure subscription of the virtual machine. |
46+
| Resource group | Select the resource group of the virtual machine. |
47+
| Target type | Select **Virtual machine**. |
48+
| Target instance | Select the virtual machine. |
49+
| Packet capture name | Enter a name or leave the default name. |
50+
| **Packet capture configuration** | |
51+
| Capture location | Select **Storage account**, **File**, or **Both**. |
52+
| Storage account | Select your **Standard** storage account. <br> This option is available if you selected **Storage account** or **Both**. |
53+
| Local file path | Enter a valid local file path where you want the capture to be saved in the target virtual machine. If you are using a Linux machine, the path must start with */var/captures*. <br> This option is available if you selected **File** or **Both**. |
54+
| Maximum bytes per packet | Enter the maximum number of bytes to be captured per each packet . All bytes are captured if left blank or 0 entered. |
55+
| Maximum bytes per session | Enter the total number of bytes that are captured before . Once the value is reached the packet capture stops. Up to 1 GB is captured if left blank. |
56+
| Time limit (seconds) | Enter the time limit of the packet capture session in seconds. Once the value is reached the packet capture stops. Up to 5 hours (18000 seconds) is captured if left blank. |
57+
| **Filtering (optional)** | |
58+
| Add filter criteria | Select **Add filter criteria** to add a new filter. |
59+
| Protocol | Select **TCP**, **UDP**, or **Any** to filter for the packet capture. |
60+
| Local IP address | Filters the packet capture for packets where the local IP address matches this value. |
61+
| Local port | Filters the packet capture for packets where the local port matches this value. |
62+
| Remote IP address | Filters the packet capture for packets where the remote IP address matches this value. |
63+
| Remote port | Filters the packet capture for packets where the remote port matches this value. |
64+
4865
> [!NOTE]
4966
> Premium storage accounts are currently not supported for storing packet captures.
5067
51-
- **Maximum bytes per packet**: The number of bytes from each packet that are captured. If left blank, all bytes are captured.
52-
- **Maximum bytes per session**: The total number of bytes that are captured. Once the value is reached the packet capture stops.
53-
- **Time limit (seconds)**: The time limit before the packet capture is stopped. The default is 18,000 seconds.
54-
- Filtering (Optional). Select **+ Add filter**
55-
- **Protocol**: The protocol to filter for the packet capture. The available values are TCP, UDP, and Any.
56-
- **Local IP address**: Filters the packet capture for packets where the local IP address matches this value.
57-
- **Local port**: Filters the packet capture for packets where the local port matches this value.
58-
- **Remote IP address**: Filters the packet capture for packets where the remote IP address matches this value.
59-
- **Remote port**: Filters the packet capture for packets where the remote port matches this value.
60-
6168
> [!NOTE]
62-
> Port and IP address values can be a single value, range of values, or a range, such as 80-1024, for port. You can define as many filters as you need.
69+
> Port and IP address values can be a single value, multiple values, or a range, such as 80-1024, for port. You can define as many filters as you need.
6370
64-
4. Select **OK**.
71+
1. Select **Start packet capture**.
6572

66-
After the time limit set on the packet capture has expired, the packet capture is stopped, and can be reviewed. You can also manually stop a packet capture session.
73+
:::image type="content" source="./media/network-watcher-packet-capture-manage-portal/add-packet-capture.png" alt-text="Screenshot of Add packet capture in Azure portal showing available options.":::
74+
75+
1. Once the time limit set on the packet capture is reached, the packet capture stops and can be reviewed. To manually stop a packet capture session before it reaches its time limit, select the **...** on the right-side of the packet capture in **Packet capture** page, or right-click it, then select **Stop**.
76+
77+
:::image type="content" source="./media/network-watcher-packet-capture-manage-portal/stop-packet-capture.png" alt-text="Screenshot showing how to stop a packet capture in Azure portal.":::
6778

6879
> [!NOTE]
69-
> The portal automatically:
70-
> * Creates a network watcher in the same region as the region the virtual machine you selected exists in, if the region doesn't already have a network watcher.
71-
> * Adds the *AzureNetworkWatcherExtension* [Linux](../virtual-machines/extensions/network-watcher-linux.md) or [Windows](../virtual-machines/extensions/network-watcher-windows.md) virtual machine extension to the virtual machine, if it's not already installed.
80+
> The Azure portal automatically:
81+
> * Creates a network watcher in the same region as the region of the target virtual machine, if the region doesn't already have a network watcher.
82+
> * Adds `AzureNetworkWatcherExtension` to [Linux](../virtual-machines/extensions/network-watcher-linux.md) or [Windows](../virtual-machines/extensions/network-watcher-windows.md) virtual machines, if the extension isn't already installed.
7283
7384
## Delete a packet capture
7485

75-
1. In the packet capture view, select **...** on the right-side of the packet capture, or right-click an existing packet capture, and select **Delete**.
76-
2. You are asked to confirm you want to delete the packet capture. Select **Yes**.
86+
1. Sign in to the [Azure portal](https://portal.azure.com).
87+
1. In the search box at the top of the portal, enter *Network Watcher*, then select **Network Watcher** from the search results.
88+
1. Select **Packet capture** under **Network diagnostic tools**.
89+
1. In the **Packet capture** page, select **...** on the right-side of the packet capture that you want to delete, or right-click it, then select **Delete**.
7790

78-
> [!NOTE]
79-
> Deleting a packet capture does not delete the capture file in the storage account or on the virtual machine.
91+
:::image type="content" source="./media/network-watcher-packet-capture-manage-portal/delete-packet-capture.png" alt-text="Screenshot showing how to delete a packet capture from Network Watcher in Azure portal.":::
8092

81-
## Stop a packet capture
93+
1. Select **Yes**.
8294

83-
In the packet capture view, select **...** on the right-side of the packet capture, or right-click an existing packet capture, and select **Stop**.
95+
> [!NOTE]
96+
> Deleting a packet capture does not delete the capture file in the storage account or on the virtual machine.
8497
8598
## Download a packet capture
8699

87-
Once your packet capture session has completed, the capture file is uploaded to blob storage or to a local file on the virtual machine. The storage location of the packet capture is defined during creation of the packet capture. A convenient tool to access capture files saved to a storage account is Microsoft Azure Storage Explorer, which you can [download](https://storageexplorer.com/).
100+
Once your packet capture session has completed, the capture file is saved to a blob storage or a local file on the target virtual machine. The storage location of the packet capture is defined during creation of the packet capture. A convenient tool to access capture files saved to a storage account is Azure Storage Explorer, which you can [download](https://storageexplorer.com/) after selecting the operating system.
88101

89-
If a storage account is specified, packet capture files are saved to a storage account at the following location:
102+
- If a storage account is specified, packet capture files are saved to a storage account at the following location:
90103

91-
```
92-
https://{storageAccountName}.blob.core.windows.net/network-watcher-logs/subscriptions/{subscriptionId}/resourcegroups/{storageAccountResourceGroup}/providers/microsoft.compute/virtualmachines/{VMName}/{year}/{month}/{day}/packetCapture_{creationTime}.cap
93-
```
104+
```
105+
https://{storageAccountName}.blob.core.windows.net/network-watcher-logs/subscriptions/{subscriptionId}/resourcegroups/{storageAccountResourceGroup}/providers/microsoft.compute/virtualmachines/{VMName}/{year}/{month}/{day}/packetCapture_{creationTime}.cap
106+
```
94107
95-
If you selected **File** when you created the capture, you can view or download the file from the path you configured on the virtual machine.
108+
- If a file path is specified, the capture file can be viewed on the virtual machine or downloaded.
96109
97110
## Next steps
98111

0 commit comments

Comments
 (0)