Skip to content

Commit cafdc09

Browse files
authored
re-added step 1
re-added Step 1 for az network watcher show and added --location to packet-capture create
1 parent 339b15f commit cafdc09

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,27 @@ The following sample is an example of the response from running `az vm extension
104104

105105
Once the preceding steps are complete, the packet capture agent is installed on the virtual machine.
106106

107-
108107
### Step 1
108+
The next step is to retrieve the Network Watcher instance. TThe name of the Network Watcher is passed to the `az network watcher show` command in a subsequent step.
109+
110+
```azurecli
111+
az network watcher show --resource-group resourceGroup --name networkWatcherName
112+
```
113+
114+
### Step 2
109115

110116
Retrieve a storage account. This storage account is used to store the packet capture file.
111117

112118
```azurecli
113119
az storage account list
114120
```
115121

116-
### Step 2
122+
### Step 3
117123

118124
At this point, you are ready to create a packet capture. First, let's examine the parameters you may want to configure. Filters are one such parameter that can be used to limit the data that is stored by the packet capture. The following example sets up a packet capture with several filters. The first three filters collect outgoing TCP traffic only from local IP 10.0.0.3 to destination ports 20, 80 and 443. The last filter collects only UDP traffic.
119125

120126
```azurecli
121-
az network watcher packet-capture create --resource-group {resourceGroupName} --vm {vmName} --name packetCaptureName --storage-account {storageAccountName} --filters "[{\"protocol\":\"TCP\", \"remoteIPAddress\":\"1.1.1.1-255.255.255\",\"localIPAddress\":\"10.0.0.3\", \"remotePort\":\"20\"},{\"protocol\":\"TCP\", \"remoteIPAddress\":\"1.1.1.1-255.255.255\",\"localIPAddress\":\"10.0.0.3\", \"remotePort\":\"80\"},{\"protocol\":\"TCP\", \"remoteIPAddress\":\"1.1.1.1-255.255.255\",\"localIPAddress\":\"10.0.0.3\", \"remotePort\":\"443\"},{\"protocol\":\"UDP\"}]"
127+
az network watcher packet-capture create --resource-group {resourceGroupName} --vm {vmName} --name packetCaptureName --storage-account {storageAccountName} --location {location} --filters "[{\"protocol\":\"TCP\", \"remoteIPAddress\":\"1.1.1.1-255.255.255\",\"localIPAddress\":\"10.0.0.3\", \"remotePort\":\"20\"},{\"protocol\":\"TCP\", \"remoteIPAddress\":\"1.1.1.1-255.255.255\",\"localIPAddress\":\"10.0.0.3\", \"remotePort\":\"80\"},{\"protocol\":\"TCP\", \"remoteIPAddress\":\"1.1.1.1-255.255.255\",\"localIPAddress\":\"10.0.0.3\", \"remotePort\":\"443\"},{\"protocol\":\"UDP\"}]"
122128
```
123129

124130
The following example is the expected output from running the `az network watcher packet-capture create` command.

0 commit comments

Comments
 (0)