Connecting Different IP Addresses to Different VMs in Hyper-V: DC1-IP: 192.168.0.10, DC2-IP: 192.168.0.11, DC3-IP: 192.168.1.10, DC4-IP: 192.168.2.10

Abstract: Assign static IP addresses to Hyper-V VMs by configuring external virtual switches and setting manual network settings in the guest OS.

Created: 2026-08-19 by
To assign distinct IP addresses like 192.168.0.10 and 192.168.1.10 to different Hyper-V virtual machines, you must configure multiple external virtual switches or use a single switch with static IP reservations on your physical router. This setup allows each VM to communicate on specific subnets while maintaining connectivity to the host network. Proper configuration ensures that domain controllers and servers remain accessible at their designated addresses without conflict.

Understanding Network Switch Requirements

Before assigning specific IP addresses, it is crucial to understand how Hyper-V handles networking. Hyper-V uses virtual switches to bridge VMs to physical networks. There are three types: External, Internal, and Private. An External switch binds to a physical NIC and allows VMs to access the outside world. An Internal switch only allows communication between the host and VMs. A Private switch isolates VMs from the host entirely. For your scenario involving four Domain Controllers (DCs) with IPs in two different subnets (192.168.0.x and 192.168.1.x), you likely need an External switch if these VMs require internet access or broader network integration. If they are isolated for testing, an Internal switch might suffice, but routing becomes complex. Most production environments use External switches connected to a physical router that handles DHCP or static IP assignments. If you are setting up a domain environment, refer to Setting up a Domain in Hyper-V with External Switches for 3 VMs: One DC, One File Server, One Workstation for best practices on integrating DCs into a larger infrastructure. This guide explains how to ensure your virtual switches are properly bound to physical adapters before configuring guest OS settings.

Configuring Virtual Switches in Hyper-V Manager

The first step is to create or verify your virtual switches. Open Hyper-V Manager on your host machine. In the right-hand actions pane, click Virtual Switch Manager. You will see existing switches listed. If you do not have an External switch, click New virtual network switch and select External. Name the switch appropriately, such as "ProductionNet". Check the box for Allow management operating system to share this network adapter. This allows the host Windows machine to retain its own network connectivity while the VMs also use that physical connection. Select the physical network adapter that provides your desired network segment. Click OK to apply changes. Note that this may briefly disconnect your host machine's network. If you need separate subnets (e.g., 192.168.0.0/24 and 192.168.1.0/24) and your physical router does not support VLAN tagging, you might need multiple physical interfaces or a more complex router configuration. However, typically, all VMs connect to the same external switch, and the IP addressing is handled within the Guest Operating System or by the router's DHCP scope.

Assigning Static IPs in the Guest OS

Once the virtual switch is configured, power on your VMs. Inside each VM, you must configure the network interface card (NIC) to use a static IP address. The method varies slightly depending on the guest OS, but the logic remains the same. For Windows Server Guests: 1. Open Server Manager or navigate to Control Panel > Network and Sharing Center. 2. Click on Change adapter settings. 3. Right-click the Ethernet adapter and select Properties. 4. Double-click on Internet Protocol Version 4 (TCP/IPv4). 5. Select Use the following IP address. 6. Enter the specific IP (e.g., 192.168.0.10 for DC1), Subnet Mask (typically 255.255.255.0), and Default Gateway (your router's IP, e.g., 192.168.0.1). 7. Set the Preferred DNS server to the local DC’s IP (for internal resolution) or your router’s IP. 8. Click OK and close the windows. For Linux Guests: Edit the network configuration file (e.g., /etc/netplan/*.yaml or /etc/network/interfaces). Define the static IP, netmask, gateway, and DNS nameservers. Apply the changes using commands like netplan apply or by restarting the network service. Ensure that DC2 (192.168.0.11) uses a different IP in the same subnet as DC1. DC3 (192.168.1.10) requires a different subnet mask or gateway configuration if it is on a physically separate network segment. If all VMs are on the same physical wire, the router must route between these subnets, or you must use VLANs.

Verifying Connectivity and Troubleshooting

After configuring the IPs, test connectivity from each VM. Use ping to check if DC1 can reach DC2. Then ping the default gateway. Finally, ping an external address like 8.8.8.8 to verify internet access. If pings fail, check the following:
  • Firewall Settings: Ensure Windows Firewall on the guest VMs allows ICMP (Ping) requests.
  • VLAN Configuration: If you are using VLANs, ensure the virtual switch is tagged correctly. Hyper-V supports VLAN IDs on both the virtual switch and individual VM NICs.
  • Duplicate IPs: Verify no other device on the network has the same IP address. Use arp -a on the host to check MAC address mappings.
If you are experiencing issues with NAT or internal switching instead of external, consider reviewing Making a Virtual Internal NAT Switch Work for Hyper-V VMs to understand how traffic flows differently in isolated environments.

Frequently Asked Questions

Can I assign different subnets to VMs on the same external switch?

Yes, you can assign different subnets to VMs connected to the same external switch. However, routing between these subnets must be handled by your physical router or a dedicated firewall/router VM. Each VM simply needs the correct IP, subnet mask, and gateway configured in its guest OS.

What happens if I forget to set a static IP?

If you do not set a static IP, the VM will request an IP via DHCP. This can lead to IP changes after reboots, causing connectivity issues for services like Active Directory. For Domain Controllers, static IPs are mandatory to ensure consistent DNS registration and domain functionality.

How do I handle VLANs in Hyper-V?

You can configure VLANs by assigning a VLAN ID to the virtual switch or directly to the VM’s network adapter in Hyper-V Manager. This tags outgoing traffic with the specified VLAN ID, allowing your physical switch to direct traffic to the correct logical network segment.

Why can’t my VMs ping each other across different subnets?

VMs on different subnets cannot communicate directly without a router. If they are on the same physical network but different logical subnets, your router must be configured to route between those subnets. Additionally, ensure that the default gateways on the VMs point to the correct router interface.

Is it safe to use private IP ranges like 192.168.x.x?

Yes, using private IP ranges is standard practice for internal networks and virtual machines. These addresses are not routable on the public internet, providing a layer of security. They are ideal for lab environments, internal domains, and isolated testing setups.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More