1

I recently learned that windows generally, server 2016 in my case can make use of the hyper-v virtual switch on the host machine as a way to tap into different vlan's.

I have a repurposed gigabyte brix(i7 4th gen, 16 gigs ram, but tiny and no place to add a second physical NIC) that I use as a windows server in my home lab, been using it for years.

My current experiments have me learning and toying with iscsi and I have made a dedicated vlan (80) just for iscsi traffic.

At present the Hyper-V virtual switch exists to serve up network traffic to 2 other server instances in VM (bare metal server only does file server duty, so I don't have to pass physical media through to a vm, I want as little running on bare metal as possible because 'checkpoints') Active directory/Domain controller is one vm, every other service needed is the other.

I wanted to toy with having a second virtual nic available to the host so one could be set to the normal vlan, and the other could be set to the experimental iscsi vlan.

Everything I can find online is about having 2 or more phyisical nics and using them in hyper-v, I want to take my 1 physical nic and by way of the virtual switch make 2 connections out of it.

Conceptually the idea is simple and I think I have seen the options in the past (maybe vmware) before any need or even having the knowledge of what a vlan was. Practically though I can't find a way to tell hyper-v manager to do this.

<Hyper V and VMware don't play nice at the same time, last time I tested, and my active directory, NPS/Radius and other services are all deployed to those VM's so jumping ship is not a practical option, also the VM's are legitimately activated off their host os's key code, something I have only ever been able to make work in hyper-v, the reason it was chosen for this use>

Theo Lehr
  • 21
  • 3
  • I really doubt that you would be able to do anything with this from the GUI, but maybe in powershell using `Add-VMNetworkAdapter` combined with `Set-VMNetworkAdapterVlan` to set the VLAN. – Zoredache Jun 23 '20 at 00:53
  • I am not opposed to using powershell but it is a weak area for me (much more comfortable in cmd, and my knowledge there is still growing), thus before pulling that trigger, a bit more clarity on what exact commands & arguments with a healthy dose of the conceptual 'why' for each – Theo Lehr Jun 23 '20 at 01:39
  • Looking up the commands named I found this page (https://docs.microsoft.com/en-us/powershell/module/hyper-v/add-vmnetworkadapter?view=win10-ps) with this command (Example 4 " PS C:\> Add-VMNetworkAdapter -ManagementOS -Name Secondary" This example adds a second virtual network adapter in the management operating system.) looks perfect but I can't see a easy way to undo it if it breaks things so I am making a 'server backup' now as, apparently I failed to notice restore points are not a thing in windows server... – Theo Lehr Jun 23 '20 at 02:02

0 Answers0