Set-VMNetworkAdapterVlan
Set-VMNetworkAdapterVlan
Configures the virtual LAN settings for the traffic through a virtual network adapter.
구문
Parameter Set: VMName
Set-VMNetworkAdapterVlan [-VMName] <String[]> [-Access] [-AllowedVlanIdList <String> ] [-Community] [-ComputerName <String[]> ] [-Isolated] [-NativeVlanId <Int32> ] [-Passthru] [-PrimaryVlanId <Int32> ] [-Promiscuous] [-SecondaryVlanId <Int32> ] [-SecondaryVlanIdList <String> ] [-Trunk] [-Untagged] [-VlanId <Int32> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: ManagementOS
Set-VMNetworkAdapterVlan -ManagementOS [-Access] [-AllowedVlanIdList <String> ] [-Community] [-ComputerName <String[]> ] [-Isolated] [-NativeVlanId <Int32> ] [-Passthru] [-PrimaryVlanId <Int32> ] [-Promiscuous] [-SecondaryVlanId <Int32> ] [-SecondaryVlanIdList <String> ] [-Trunk] [-Untagged] [-VlanId <Int32> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: ResourceObject
Set-VMNetworkAdapterVlan [-VMNetworkAdapter] <VMNetworkAdapterBase[]> [-Access] [-AllowedVlanIdList <String> ] [-Community] [-Isolated] [-NativeVlanId <Int32> ] [-Passthru] [-PrimaryVlanId <Int32> ] [-Promiscuous] [-SecondaryVlanId <Int32> ] [-SecondaryVlanIdList <String> ] [-Trunk] [-Untagged] [-VlanId <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: VMObject
Set-VMNetworkAdapterVlan [-VM] <VirtualMachine[]> [-Access] [-AllowedVlanIdList <String> ] [-Community] [-Isolated] [-NativeVlanId <Int32> ] [-Passthru] [-PrimaryVlanId <Int32> ] [-Promiscuous] [-SecondaryVlanId <Int32> ] [-SecondaryVlanIdList <String> ] [-Trunk] [-Untagged] [-VlanId <Int32> ] [-VMNetworkAdapterName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
자세한 설명
The Set-VMNetworkAdapterVlan cmdlet configures virtual LAN settings for the traffic through a virtual network adapter. Access, Trunk, Private VLAN (isolated, community, or promiscuous), and untagged are mutually exclusive.
매개 변수
-Access
Specifies Access mode for the virtual machine network adapter. This parameter must be specified in conjunction with parameter VlanId.
별칭 |
a |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-AllowedVlanIdList<String>
Specifies a list of virtual LANs allowed on a virtual machine network adapter. This parameter must be specified in conjunction with the switch parameter Trunk.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Community
Specifies Community mode for the virtual machine network adapter to be configured. This parameter must be specified in conjunction with parameters PrimaryVlanId and SecondaryVlanId.
별칭 |
c |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-ComputerName<String[]>
Specifies one or more Hyper-V hosts on which the virtual LAN settings on a virtual machine network adapter are to be configured. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer — use “localhost” or a dot (“.”) to specify the local computer explicitly.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Isolated
Specifies Isolated mode for the virtual machine network adapter to be configured. This parameter must be specified in conjunction with parameters PrimaryVlanId and SecondaryVlanId.
별칭 |
i |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-ManagementOS
Specifies the management (e.g. parent OS, or host) operating system.
별칭 |
없음 |
필수 여부 |
true |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-NativeVlanId<Int32>
Specifies the native virtual LAN identifier for a virtual machine network adapter. This parameter must be specified in conjunction with the switch parameter Trunk.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Passthru
Specifies that a Microsoft.HyperV.PowerShell.VMNetworkAdapterVlanSetting object is to be passed through to the pipeline representing the virtual machine network adapter virtual LAN settings to be configured.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-PrimaryVlanId<Int32>
Specifies the primary virtual LAN identifier for a virtual network adapter in Community, Isolated, or Promiscuous mode.
This parameter must be specified in conjunction with parameter SecondaryVlanId if the virtual machine network adapter is in Community or Isolated mode. It must be used in conjunction with parameter SecondaryVlanIdList if the virtual machine network adapter is in Promiscuous mode.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Promiscuous
Specifies Promiscuous mode for the virtual machine network adapter.
This parameter must be specified in conjunction with parameters PrimaryVlanId and SecondaryVlanIdList.
별칭 |
p |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-SecondaryVlanId<Int32>
Specifies the secondary virtual LAN identifier for a virtual network adapter in Community or Isolated mode.
This parameter must be specified in conjunction with parameter PrimaryVlanId, along with switch parameter Community or Isolated.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-SecondaryVlanIdList<String>
Specifies a list of private virtual LAN secondary virtual LANs on a virtual machine network adapter.This parameter must be specified in conjunction with parameter PrimaryVlanId and switch parameter Promiscuous.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Trunk
Specifies Trunk mode for the virtual machine network adapter. This parameter must be used in conjunction with parameters AllowedVlanIdList and NativeVlanId.
별칭 |
t |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Untagged
Specifies Untagged mode for the virtual machine network adapter.
별칭 |
u |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-VM<VirtualMachine[]>
Specifies the virtual machine.
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
True (ByValue) |
와일드카드 문자 허용 여부 |
false |
-VMName<String[]>
Specifies the name of the virtual machine.
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
True (ByValue) |
와일드카드 문자 허용 여부 |
false |
-VMNetworkAdapter<VMNetworkAdapterBase[]>
Specifies the virtual machine network adapter.
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
True (ByValue) |
와일드카드 문자 허용 여부 |
false |
-VMNetworkAdapterName<String>
Specifies the name of the virtual machine network adapter.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-VlanId<Int32>
Specifies the virtual LAN identifier of a virtual machine network adapter. This parameter must be specified in conjunction with switch parameter Access.
별칭 |
AccessVlanId |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
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을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).
입력
입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.
출력
출력 유형은 cmdlet이 내보내는 개체의 유형입니다.
- None by default; Microsoft.HyperV.PowerShell.VMNetworkAdapterVlanSetting if –PassThru is specified.
예제
Example 1
Sets the virtual network adapter(s) in virtual machine Redmond to the Access mode. Traffic sent by this virtual machine is tagged with VLAN ID 121.
PS C:\> Set-VMNetworkAdapterVlan –VMName Redmond –Access –VlanId 121
Example 2
Sets the virtual network adapter(s) in virtual machine Redmond to the Trunk mode. Any traffic tagged with one of the VLAN IDs in the allowed VLAN list will be permitted to be sent or received by the VLAN. If traffic is untagged, it will be treated as if it were on VLAN 10.
PS C:\> Set-VMNetworkAdapterVlan -VMName Redmond -Trunk -AllowedVlanIdList 1-100 -NativeVlanId 10
Example 3
Gets the virtual network adapters from virtual machine Redmond and sets them to the Private VLAN isolated mode, where primary VLAN is 10 and the secondary VLAN is 200.
PS C:\> Get-VMNetworkAdapter -VMName Redmond | Set-VMNetworkAdapterVlan -Isolated -PrimaryVlanId 10 -SecondaryVlanId 200
Example 4
Gets the virtual network adapters from virtual machine WA and sets them to the Private VLAN promiscuous mode, where primary VLAN is 10 and the secondary VLANs are 201 and 202.
PS C:\> Get-VMNetworkAdapter -VMName WA | Set-VMNetworkAdapterVlan -Promiscuous -PrimaryVlanId 10 -SecondaryVlanIdList 200-201
Example 5
Gets virtual machine Redmond and sets the virtual network adapters in the virtual machine to the untagged mode.
PS C:\> Get-VM Redmond | Set-VMNetworkAdapterVlan -Untagged