az network watcher packet-capture

VM에서 패킷 캡처 세션을 관리합니다.

이러한 명령을 사용하려면 VM 지역에 대해 Azure Network Watcher 모두 사용하도록 설정되고 VM에서 AzureNetworkWatcherExtension을 사용하도록 설정해야 합니다. 자세한 내용은 https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-cli 를 방문하세요.

명령

az network watcher packet-capture create

패킷 캡처 세션을 만들고 시작합니다.

az network watcher packet-capture delete

패킷 캡처 세션을 삭제합니다.

az network watcher packet-capture list

리소스 그룹 내의 모든 패킷 캡처 세션을 나열합니다.

az network watcher packet-capture show

패킷 캡처 세션의 세부 정보를 표시합니다.

az network watcher packet-capture show-status

패킷 캡처 세션의 상태를 표시합니다.

az network watcher packet-capture stop

실행 중인 패킷 캡처 세션을 중지합니다.

az network watcher packet-capture create

패킷 캡처 세션을 만들고 시작합니다.

az network watcher packet-capture create --name
                                         --resource-group
                                         --vm
                                         [--capture-limit]
                                         [--capture-size]
                                         [--file-path]
                                         [--filters]
                                         [--storage-account]
                                         [--storage-path]
                                         [--subscription]
                                         [--time-limit]

예제

VM에서 패킷 캡처 세션을 만듭니다.

az network watcher packet-capture create -g MyResourceGroup -n MyPacketCaptureName --vm MyVm --storage-account MyStorageAccount

프로토콜, 로컬 IP 주소 및 원격 IP 주소 범위 및 포트에 대한 선택적 필터를 사용하여 VM에 패킷 캡처 세션을 만듭니다.

az network watcher packet-capture create -g MyResourceGroup -n MyPacketCaptureName --vm MyVm \
    --storage-account MyStorageAccount --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" \
        }]'

필수 매개 변수

--name -n

패킷 캡처 세션의 이름입니다.

--resource-group -g

대상 VM이 있는 리소스 그룹의 이름입니다.

--vm

대상으로 지정할 VM의 이름 또는 ID입니다.

선택적 매개 변수

--capture-limit

캡처 출력의 최대 크기(바이트)입니다.

--capture-size

패킷당 캡처된 바이트 수입니다. 초과하는 바이트는 잘립니다.

--file-path

패킷 캡처를 저장할 대상 VM의 로컬 경로입니다. Linux VM의 경우 경로가 /var/captures로 시작해야 합니다.

--filters

JSON으로 인코딩된 패킷 필터 목록입니다. 를 사용하여 @{path} 파일에서 로드합니다.

--storage-account

패킷 캡처를 저장할 스토리지 계정의 이름 또는 ID입니다.

--storage-path

캡처 파일을 저장할 기존 스토리지 컨테이너의 정규화된 URI입니다.

--subscription

구독의 이름 또는 ID입니다. 를 사용하여 기본 구독을 구성할 수 az account set -s NAME_OR_ID 있습니다.

--time-limit

캡처 세션의 최대 기간(초)입니다.

az network watcher packet-capture delete

패킷 캡처 세션을 삭제합니다.

az network watcher packet-capture delete --location
                                         --name
                                         [--subscription]

예제

패킷 캡처 세션을 삭제합니다. 이렇게 하면 캡처 파일이 아닌 세션만 삭제됩니다.

az network watcher packet-capture delete -n packetCaptureName -l westcentralus

패킷 캡처 세션을 삭제합니다. (자동 생성)

az network watcher packet-capture delete --location westcentralus --name packetCaptureName --subscription MySubscription

필수 매개 변수

--location -l

위치입니다. 값 출처: az account list-locations. az configure --defaults location=<location>을 사용하여 기본 위치를 구성할 수 있습니다.

--name -n

패킷 캡처 세션의 이름입니다.

선택적 매개 변수

--subscription

구독의 이름 또는 ID입니다. 를 사용하여 기본 구독을 구성할 수 az account set -s NAME_OR_ID 있습니다.

az network watcher packet-capture list

리소스 그룹 내의 모든 패킷 캡처 세션을 나열합니다.

az network watcher packet-capture list --location
                                       [--query-examples]
                                       [--subscription]

예제

지역 내의 모든 패킷 캡처 세션을 나열합니다.

az network watcher packet-capture list -l westus

리소스 그룹 내의 모든 패킷 캡처 세션 나열(자동 생성)

az network watcher packet-capture list --location westus --subscription MySubscription

필수 매개 변수

--location -l

위치입니다. 값 출처: az account list-locations. az configure --defaults location=<location>을 사용하여 기본 위치를 구성할 수 있습니다.

선택적 매개 변수

--query-examples

JMESPath 문자열을 권장합니다. 쿼리 중 하나를 복사하여 큰따옴표 안에 --query 매개 변수를 붙여넣어 결과를 볼 수 있습니다. 이러한 키워드를 기반으로 제안을 제공할 수 있도록 하나 이상의 위치 키워드를 추가할 수 있습니다.

--subscription

구독의 이름 또는 ID입니다. 를 사용하여 기본 구독을 구성할 수 az account set -s NAME_OR_ID 있습니다.

az network watcher packet-capture show

패킷 캡처 세션의 세부 정보를 표시합니다.

az network watcher packet-capture show --location
                                       --name
                                       [--query-examples]
                                       [--subscription]

예제

패킷 캡처 세션을 표시합니다.

az network watcher packet-capture show -l westus -n MyPacketCapture

필수 매개 변수

--location -l

위치입니다. 값 출처: az account list-locations. az configure --defaults location=<location>을 사용하여 기본 위치를 구성할 수 있습니다.

--name -n

패킷 캡처 세션의 이름입니다.

선택적 매개 변수

--query-examples

JMESPath 문자열을 권장합니다. 쿼리 중 하나를 복사하여 큰따옴표 안에 --query 매개 변수를 붙여넣어 결과를 볼 수 있습니다. 이러한 키워드를 기반으로 제안을 제공할 수 있도록 하나 이상의 위치 키워드를 추가할 수 있습니다.

--subscription

구독의 이름 또는 ID입니다. 를 사용하여 기본 구독을 구성할 수 az account set -s NAME_OR_ID 있습니다.

az network watcher packet-capture show-status

패킷 캡처 세션의 상태를 표시합니다.

az network watcher packet-capture show-status --location
                                              --name
                                              [--subscription]

예제

패킷 캡처 세션의 상태를 표시합니다.

az network watcher packet-capture show-status -l westus -n MyPacketCapture

필수 매개 변수

--location -l

위치입니다. 값 출처: az account list-locations. az configure --defaults location=<location>을 사용하여 기본 위치를 구성할 수 있습니다.

--name -n

패킷 캡처 세션에 지정된 이름입니다.

선택적 매개 변수

--subscription

구독의 이름 또는 ID입니다. 를 사용하여 기본 구독을 구성할 수 az account set -s NAME_OR_ID 있습니다.

az network watcher packet-capture stop

실행 중인 패킷 캡처 세션을 중지합니다.

az network watcher packet-capture stop --location
                                       --name
                                       [--subscription]

예제

실행 중인 패킷 캡처 세션을 중지합니다.

az network watcher packet-capture stop -l westus -n MyPacketCapture

필수 매개 변수

--location -l

위치입니다. 값 출처: az account list-locations. az configure --defaults location=<location>을 사용하여 기본 위치를 구성할 수 있습니다.

--name -n

패킷 캡처 세션의 이름입니다.

선택적 매개 변수

--subscription

구독의 이름 또는 ID입니다. 를 사용하여 기본 구독을 구성할 수 az account set -s NAME_OR_ID 있습니다.