Friday, February 18, 2022

Windows Server 2022 Hyper-V Virtual Network configuration

New way to create a Virtual Switch on WS2022 Hyper-V

Step one is name the interfaces Prod1 / Prod 2

Create a virtual switch and team the NIC's at the same time

New-VMSwitch -Name "ProdSwitch" -NetAdapterName "Prod1","Prod2" -EnableEmbeddedTeaming $true

Create network adapters as needed, I generally create a Management and a production VM network interface.. code example below.

Add-VMNetworkAdapter -ManagementOS -Name “MGMT” -SwitchName “ProdSwitch”

Add-VMNetworkAdapter -ManagementOS -Name “VM” -SwitchName “ProdSwitch”

Generally you will require VLAN's for each of these interfaces and below are examples of the code required for this XX being the VLAN ID.

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "MGMT" -Access -Vlanid XX

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "VM" -Access -Vlanid XX

No comments:

Post a Comment