Forum Discussion
Assign IP Address for Windows Server 2025 VM on Hyper-V
I have built my first Windows Server 2025 VM on HyperV and trying to assign an IP address. I want the VM's to be like an actual server so I Created an external vswitch. The HyperV server IP is 172.16.1.41 with a physical gateway of 172.16.1.5. I have tried to assign the new VM with 172.16.1.42/255.255.255.0 and the Gateway is 172.16.1.5 also. However, I cannot get a positive ping. Do I need another VSWITCH configured or what am I missing?
1 Reply
You do not need a second virtual switch. One external Hyper-V switch can connect the host and VM to 172.16.1.0/24. Confirm the VM adapter is attached to that switch, the switch is bound to the correct physical NIC, and Allow management operating system to share this network adapter is enabled if the host uses that NIC. In the guest, verify 172.16.1.42, mask 255.255.255.0, gateway 172.16.1.5, and DNS, then confirm the address is unused. Test the guest address, host, and gateway in that order. Check the VM adapter’s VLAN setting; leave it untagged unless the physical switch requires a specific VLAN. Windows Firewall may block inbound ping, so also test outbound connectivity from the guest. If the gateway remains unreachable, inspect the physical switch for port security or MAC-address limits, because Hyper-V places the VM’s MAC behind the host port.