VLAN trunking in Hyper-V. Virtual switch to VM

1.  get interface

PS C:\Windows\system32> Get-VMNetworkAdapter -VMName pfs3|fl adapterid,ipaddresses

AdapterId   : 258ffea6-f8ea-46af-a376-7c2b912fe68e
IPAddresses : {,, fe80::215:5dff:fe05:a869}

AdapterId   : 39aeda55-19b3-403c-9c89-d0bf937a4930
IPAddresses : {,,, fe80::215:5dff:fe05:a86a...}

AdapterId   : e579b3aa-8bc6-4ca0-9c39-3fbb568dd205
IPAddresses : {, fe80::215:5dff:fe05:a86d}

2. set VLANs

PS C:\Windows\system32> Get-VMNetworkAdapter -VMName pfs4 |Where-Object {$_.adapterid -eq '5d488e8c-b066-4350-acfb-b4ccc
57a9ee7'}|Set-VMNetworkAdapterVlan -trunk -AllowedVlanIdList 1901-1924 -NativeVlanId 1924


Leave a Reply

Your email address will not be published. Required fields are marked *