VLAN tagging
Refer to the following documentation:
Configure virtual local area networks for Hyper-V
Hyper-V PowerShell Module
Hyper-V PowerShell Module is required to configure VLAN tagging. To view a list of Hyper-V related cmdlets on the system, type
PS C:\> Get-Command –Module Hyper-V
If the system does not return results, the Hyper-V PowerShell module must be installed. The module must be imported separately, by doing the following:
-
Load the ServerManager Module. Type
Import-Module ServerManager
-
To respond to the security warning, type 'R' <ENTER> to proceed with loading the ServerManager module.
-
Load the Hyper-V PowerShell Module located in the Remote Server Administration Tools feature. Type
Add-WindowsFeature RSAT-Hyper-V-Tools –IncludeAllSubFeature
-
After a few minutes you'll receive the system response that the installation was successful and that no restart (reboot) is needed.
Configure VLAN Tagging
-
To create virtual adapters and tag VLANs, type:
Add-VMNetworkAdapter -SwitchName HYPERV1 -VMName "NS-Application-Server" –Name "port2"
Set-VMNetworkAdapterVlan -Trunk -AllowedVlanIdList "317,318" -VMName "NS-Application-Server" -VMNetworkAdapterName "port2" -NativeVlanId 1
-
Confirm that the changes have been applied. Type
Get-VMNetworkAdapterVlan
For more details and additional commands regarding VLAN tagging, refer to the following Microsoft document:
Supported CentOS and Red Hat Enterprise Linux virtual machines on Hyper-V