Add-VMNetworkAdapterExtendedAcl

Add-VMNetworkAdapterExtendedAcl

Creates an extended ACL for a virtual network adapter.

구문

Parameter Set: VMName
Add-VMNetworkAdapterExtendedAcl [-VMName] <String[]> [-Action] <VMNetworkAdapterExtendedAclAction> {Allow | Deny} [-Direction] <VMNetworkAdapterExtendedAclDirection> {Inbound | Outbound} [[-LocalIPAddress] <String> ] [[-RemoteIPAddress] <String> ] [[-LocalPort] <String> ] [[-RemotePort] <String> ] [[-Protocol] <String> ] [-Weight] <Int32]> [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-IdleSessionTimeout <Int32]> ] [-IsolationID <Int32]> ] [-Passthru] [-Stateful <Boolean]> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ManagementOS
Add-VMNetworkAdapterExtendedAcl [-Action] <VMNetworkAdapterExtendedAclAction> {Allow | Deny} [-Direction] <VMNetworkAdapterExtendedAclDirection> {Inbound | Outbound} [[-LocalIPAddress] <String> ] [[-RemoteIPAddress] <String> ] [[-LocalPort] <String> ] [[-RemotePort] <String> ] [[-Protocol] <String> ] [-Weight] <Int32]> -ManagementOS [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-IdleSessionTimeout <Int32]> ] [-IsolationID <Int32]> ] [-Passthru] [-Stateful <Boolean]> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ResourceObject
Add-VMNetworkAdapterExtendedAcl [-VMNetworkAdapter] <VMNetworkAdapterBase[]> [-Action] <VMNetworkAdapterExtendedAclAction> {Allow | Deny} [-Direction] <VMNetworkAdapterExtendedAclDirection> {Inbound | Outbound} [[-LocalIPAddress] <String> ] [[-RemoteIPAddress] <String> ] [[-LocalPort] <String> ] [[-RemotePort] <String> ] [[-Protocol] <String> ] [-Weight] <Int32]> [-IdleSessionTimeout <Int32]> ] [-IsolationID <Int32]> ] [-Passthru] [-Stateful <Boolean]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMObject
Add-VMNetworkAdapterExtendedAcl [-VM] <VirtualMachine[]> [-Action] <VMNetworkAdapterExtendedAclAction> {Allow | Deny} [-Direction] <VMNetworkAdapterExtendedAclDirection> {Inbound | Outbound} [[-LocalIPAddress] <String> ] [[-RemoteIPAddress] <String> ] [[-LocalPort] <String> ] [[-RemotePort] <String> ] [[-Protocol] <String> ] [-Weight] <Int32]> [-IdleSessionTimeout <Int32]> ] [-IsolationID <Int32]> ] [-Passthru] [-Stateful <Boolean]> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The Add-VMNetworkAdapterExtendedAcl cmdlet creates an extended access control list (ACL) for a virtual network adapter. The ACL allows or denies access to a virtual machine network adapter for network packets based on source IP address, destination IP address, protocol, source port, and destination port.

매개 변수

-Action<VMNetworkAdapterExtendedAclAction>

Specifies the action for the ACL. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- Allow
-- Deny

별칭

none

필수 여부

true

위치

2

기본값

None

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-CimSession<Microsoft.Management.Infrastructure.CimSession[]>

원격 세션이나 원격 컴퓨터에서 cmdlet을 실행합니다. 컴퓨터 이름이나 New-CimSession 또는 Get-CimSession cmdlet의 출력과 같은 세션 개체를 입력하세요. 기본값은 로컬 컴퓨터 상의 현재 세션입니다.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-ComputerName<String[]>

Specifies an array of Hyper-V hosts. The cmdlet adds the ACL to the network adapters on the Hyper-V hosts that you specify.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Credential<System.Management.Automation.PSCredential[]>

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Direction<VMNetworkAdapterExtendedAclDirection>

Specifies the direction of network traffic, from the perspective of the virtual machine, to which the ACL applies. The cmdlet adds an ACL that has the value that you specify. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- Inbound
-- Outbound

If you run the Get-VMNetworkAdapterExtendedAcl cmdlet, the entry that you create appears in both the inbound ACL and the outbound ACL.

별칭

none

필수 여부

true

위치

3

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-IdleSessionTimeout<Int32]>

Specifies a time-out period, in seconds, for idle sessions.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-IsolationID<Int32]>

Specifies an ID of a virtual subnet. The cmdlet adds an ACL that applies to traffic on the isolated network that you specify. The subnet uses virtual local area network (VLAN) or Hyper-V Network Virtualization. For more information about isolation IDs, see the Set-VmNetworkAdapterIsolation cmdlet.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-LocalIPAddress<String>

Specifies the local IP address for the ACL. For an inbound packet, the local address is the destination IP address. For an outbound packet, the local address is the source IP address. You can specify a host address or a subnet address, or specify a wildcard, such as 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all IPv4 and IPv6 addresses.

별칭

none

필수 여부

false

위치

4

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-LocalPort<String>

Specifies the local port for the ACL. For an inbound TCP or UDP packet, the local port is the destination port. For an outbound packet, the local port is the source port.

별칭

none

필수 여부

false

위치

6

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-ManagementOS

Indicates that the cmdlet operates on the parent or host operating system. If you specify this parameter, this cmdlet creates an ACL that applies to the parent or host operating system.

별칭

none

필수 여부

true

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Passthru

작업 중인 항목을 나타내는 개체를 반환합니다. 기본적으로 이 cmdlet은 출력을 생성하지 않습니다.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Protocol<String>

Specifies the protocol that the ACL applies to. 이 매개 변수에 허용되는 값은 다음과 같습니다.

-- TCP
-- UDP
-- ICMP
-- an integer IP protocol ID

별칭

none

필수 여부

false

위치

8

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-RemoteIPAddress<String>

Specifies the local IP address for the ACL. For an inbound packet, the remote address is the source IP address. For an outbound packet, the remote address is the destination IP address. You can specify a host address or a subnet address, or specify a wildcard, such as 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all IPv4 and IPv6 addresses.

별칭

none

필수 여부

false

위치

5

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-RemotePort<String>

Specifies the remote port for the ACL. For an inbound TCP or UDP packet, the remote port is the source port. For an outbound packet, the remote port is the destination port.

별칭

none

필수 여부

false

위치

7

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Stateful<Boolean]>

Indicates whether the ACL applies to packets in both directions of the same session. If you specify a value of $True, the ACL applies to a return packet even though that packet has the opposite direction with respect to the ACL.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-VM<VirtualMachine[]>

Specifies an array of virtual machine objects. The cmdlet adds an ACL for the virtual machines that you specify. To obtain a virtual machine object, use the Get-VM cmdlet.

별칭

none

필수 여부

true

위치

1

기본값

none

파이프라인 입력 허용 여부

True (ByValue)

와일드카드 문자 허용 여부

false

-VMName<String[]>

Specifies an array of names of virtual machines. The cmdlet adds an ACL for the virtual machines that you specify.

별칭

none

필수 여부

true

위치

1

기본값

none

파이프라인 입력 허용 여부

True (ByValue)

와일드카드 문자 허용 여부

false

-VMNetworkAdapter<VMNetworkAdapterBase[]>

Specifies an array VM network adapters as VMNetworkAdapterBase objects. The cmdlet adds an ACL to the adapters that you specify. To obtain a network adapter, use the Get-VMNetworkAdapter cmdlet.

별칭

none

필수 여부

true

위치

1

기본값

none

파이프라인 입력 허용 여부

True (ByValue)

와일드카드 문자 허용 여부

false

-VMNetworkAdapterName<String>

Specifies the name of a virtual network adapter. The cmdlet adds an ACL to the adapter that you specify.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Weight<Int32]>

Specifies the weight of an ACL entry. Larger weight values apply first, and once an ACL entry applies to a packet, other entries are no longer relevant for that packet.

별칭

none

필수 여부

true

위치

9

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지를 표시합니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행되는 경우 발생할 결과를 보여 줍니다. cmdlet은 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable 등의 일반 매개 변수를 지원합니다. 자세한 내용은 TechNet의 about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216)

입력

입력 형식은 cmdlet으로 파이프할 수 있는 개체의 형식입니다.

  • None

출력

출력 형식은 cmdlet 실행 시 출력되는 개체의 형식입니다.

  • Microsoft.HyperV.PowerShell.VMNetworkAdapterExtendedAclSetting

Example 1: Create an ACL for Remote Desktop Protocol

This command creates a stateful inbound ACL that allows a remote device to connect to the virtual machine on port 3389, which is the port for Remote Desktop Protocol.

PS C:\> Add-VMNetworkAdapterExtendedAcl -VMName "TSQA01" -Action Allow -Direction Inbound -LocalPort "3389" -Protocol "TCP" -Weight 10 -Stateful $True

Example 2: Create an ACL to initiate a connection with timeout

This command creates a stateful ACL that allows outbound packets to a remote device by using TCP. If there is no activity for 3600 seconds, the connection times out.

PS C:\> Add-VMNetworkAdapterExtendedAcl -VMName "TSQA03" -Action Allow -Direction Outbound -RemotePort "80" -Protocol "TCP" -Weight 100 -Timeout 3600 -Stateful $True 

관련 항목

Get-VMNetworkAdapterExtendedAcl

Remove-VMNetworkAdapterExtendedAcl

Get-VM

Set-VmNetworkAdapterIsolation