Configure VLANs in Windows

2 min

Prerequisites

Before proceeding please check that the machine hosting the Domotz Collector is plugged in on to a trunk port of your switch which is able to see all your VLANs.

Configuration

With recent changes on how Windows manage network, with components from Hyper-V that is now installed by default, it is now possible to configure VLANs without third-party software.

It is a 3-step process, create a virtual switch, create a virtual network interface and set this vNIC in access mode to the VLAN you want to monitor.

1. Create Virtual Switch

If you have Hyper-V installed you can use GUI to create a Virtual Switch connected to the host physical NIC attached to a switch port that is allowed into the VLANs you want to monitor. Open the Hyper-V Manager and select the Virtual Switch Manager:

Hyper-V Manager > Virtual Switch Manager

You can also create the Virtual Switch manually using PowerShell in administrator mode if you don’t have the Hyper-V Manager installed:

a) List the NICs you have attached to the host:

Get-NetAdapter

b) Create the Virtual Switch attached to the interface:

New-VMSwitch -Name "vSwitchWired" -NetAdapterName "Ethernet 5" -AllowManagementOS: $true

2. Create Virtual NIC (vNIC)

Add-VMNetworkAdapter -ManagementOS -Name "VLAN66" -SwitchName vSwitchWired

3. Set the vNIC to access mode on the VLAN you want to monitor

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName VLAN66 -Access -VlanId 666

Repeat the steps 2 and 3 for all VLANs you want to monitor.

Since these vNICs are newly created, please restart the Domotz Agent service to accelerate their detection. This will restart the Collector and trigger an immediate NIC scan.

You can do this from the Services (services.msc) applet. Locate Domotz Agent, right-click it, and select Restart”:

Within some minutes , the Collector will report devices from the additional VLANs as online:

If new devices are not being discovered, the issue might be related to NPCAP.

To verify this, check the collector logs at:

http://127.0.0.1:3000/api/v1/log/flush

Search for: "Cannot find MAC address for device with IP"

If you find messages similar to the following:

"2024-03-11T23:57:50.389Z (897) [W] Cannot find MAC address for device with IP <10.100.71.7>",
"2024-03-11T23:57:50.394Z (897) [W] Cannot find MAC address for device with IP <10.100.71.6>",
"2024-03-11T23:57:50.409Z (897) [W] Cannot find MAC address for device with IP <10.100.71.9>",
"2024-03-11T23:57:50.413Z (897) [W] Cannot find MAC address for device with IP <10.100.71.8>",
"2024-03-11T23:57:50.425Z (897) [W] Cannot find MAC address for device with IP <10.100.55.222>",
"2024-03-11T23:57:50.464Z (897) [W] Cannot find MAC address for device with IP <10.100.71.10>",


…it confirms that NPCAP is likely malfunctioning.

To resolve this:

1. Uninstall NPCAP from your system.


2. Reinstall it using the version available here:
https://npcap.com/dist/npcap-1.79.exe

3. Restart the Domotz Collector Service once the installation is complete:

Note that depending on the NIC you have installed on your host, you may be able to manage these virtual interfaces connected to VLANs using their proprietary tool, see below two examples.

Realtek NICs

If you are using a Realtek NIC, you have to install the Realtek Ethernet Diagnostic Utility and with that Tool configure the additional VLANs:

A new Virtual Interface will be created for each VLAN you add for both Intel or Realtek.

Intel NICs

If you use Intel NICs, here they have more details about the models and how to do it: https://www.intel.com/content/www/us/en/support/articles/000005677/network-and-i-o/ethernet-products.html\

Other NICs manifacturers

Other brands may have a similar tools, you might check their website.

If the configuration of VLANs on Windows seems to be too complicated or it raises issues, you might think on moving the Domotz Collector on a Linux Virtual Machine. 
 
Remember that we also ship pre-configured virtual machines with the Domotz Collector already installed for the following hypervisors:
 
– Oracle Virtual Box: https://help.domotz.com/user-guide/domotz-installation-virtual-box/

– Vmware Esxi: https://help.domotz.com/user-guide/domotz-installation-vmware-esxi/

– Hyper-V: https://help.domotz.com/user-guide/domotz-installation-hyper-v/

– Proxmox: https://help.domotz.com/user-guide/domotz-installation-proxmox/

Share via Social Networks

You might also like…

Read more top posts in this category

Want more tips on Network Monitoring?

Ready to Get Started?

  • Uncover Network Blind Spots
  • Resolve Issues Faster and Easier
  • Exceed Service Delivery Expectations