HyperV VLAN trunks

From Help
Jump to: navigation, search

Set-VMNetworkAdapterVlan -VMName 'NEW elastix' -Trunk -AllowedVlanIdList 1-20 -NativeVlanId 1

Format: Brief Scope

Return to Main Page

Prerequisites

  • VLAN list
  • PowerShell access

Return to Top

Steps

  • On the HyperV server, open up an administrative PowerShell window
  • Set-VMNetworkAdapterVlan -VMName name -Trunk -AllowedVlanIDList xx-xx -NativeVlanID x
    • replace name with the VM name, use ' if it's more than one word.
    • replace xx-xx with the numbers of the VLANs you need to trunk into this machine. Like 1-2, 5-10, 5, etc.
    • replace x with the native vlan for this VM
      • NOTE: the default native vlan on HyperV is 0. It is NOT 1 like in Cisco and other network switches.
    • example: Set-VMNetworkAdapterVlan -VMName 'NEW elastix' -Trunk -AllowedVlanIdList 1-20 -NativeVlanId 0
  • You can obtain the list of VMs:
    • to get currently running: Get-VM | where { $.State -eq 'Running' }
    • all VM on server: Get-VM

Return to Top

References

Return to Top