If you’re running a Hyper-V virtual machine, you may want to assign a static IP address to it. Today in this article, we have covered how to Assign Static IP to Hyper-V virtual machine. Here’s how to do it.
- 1 How to Assign Static IP to Hyper-V virtual machine?
- 2 Why do you need to assign a static IP to a Hyper-V virtual machine?
- 3 How to Assign Static IP to Hyper-V virtual machine:
How to Assign Static IP to Hyper-V virtual machine?
In our previous post, we covered ways to reserve static IP via DHCP.
Assuming that your Hyper-V host has a network card configured with a static IP address and that you would like to configure your virtual machine to have a static IP address, there are a couple of things you will need to do.
- First, make sure that the network card on your virtual machine is configured for “External Network”.
- This can be done by selecting the “Network Adapter” setting from the “Action” menu in the Hyper-V Manager.
- Next, you must open the “Virtual Network Manager” from the “Action” menu. In the “Virtual Network Manager”, select the “External Network” to which your host is connected, and then click on the “Properties” button.
- In the properties window, go to the “Networking” tab, and select “Static IP Address Pool” from the drop-down menu.
- Click on the “Add” button, and enter an IP address and subnet mask for your virtual machine. Remember to leave enough IP addresses in the pool for any other virtual machines you might create on this host.
- Click on the “OK” button when you are done. You should now be able to access your virtual machine by using the static IP address you assigned.
Why do you need to assign a static IP to a Hyper-V virtual machine?
If you’re running a server in a Hyper-V virtual machine, you’ll need to assign it a static IP address.
Otherwise, the server will have a different IP address every time it starts up, which can cause problems with remote access and other services.
How to Assign Static IP to Hyper-V virtual machine:
If you have a Hyper-V virtual machine that you want to be able to access using a static IP address, you can follow the instructions below to configure it.
- Open the Hyper-V Manager console and select the virtual machine you want to configure.
- In the Actions pane, click on the Settings option.
- Select the Network Adapters option in the left pane of the Settings window.
- Select the network adapter you want to configure in the right pane and click on the Properties button.
- In the Properties window, select the IPv4 protocol and click on the Properties button.
- In the IPv4 Properties window, select the Manual option next to “IP Address.”
- Enter the static IP address you want to use for this virtual machine and click OK.
How to verify the static IP address configuration on a Hyper-V virtual machine?
You can verify the static IP address configuration on a Hyper-V virtual machine in two ways.
The first way is to check the IP configuration of the virtual machine from within the guest operating system. To do this, follow these steps:
- Log on to the guest operating system on the virtual machine.
- Click Start, and then click Control Panel.
- In Control Panel, double-click Network Connections.
- Right-click the network connection you want to check, and then click Properties.
- In the Properties dialogue box, click Internet Protocol Version 4 (TCP/IPv4), then click Properties.
- In the Internet Protocol Version 4 (TCP/IPv4) Properties dialogue box, verify that an IP address is not selected automatically.
- Then verify that the following IP address is selected, that an IP address is entered in the IP Address box, and that a subnet mask is entered in the Subnet Mask box.
How to troubleshoot static IP address configuration issues on a Hyper-V virtual machine?
If you are having issues configuring a static IP address on a Hyper-V virtual machine, there are a few things you can do to troubleshoot the issue.
First, check the IP address configuration of the virtual machine. Ensure that the static IP address is entered correctly and that the correct subnet mask is used.
Next, check the IP address configuration of the host machine. Ensure that the host machine is configured to use the correct subnet mask for the static IP address range you are using.
Finally, check the networking configuration of the virtual machine. Ensure that the networking mode is set to “Bridged” and that the correct network adapter is selected.
While there are a few different ways to assign static IP addresses to your Hyper-V virtual machines, using PowerShell is by far the quickest and easiest method.
Not only is it quick and easy, but it’s also very consistent across all your Hyper-V hosts.
PowerShell is definitely the way to go if you need to assign static IP addresses to your Hyper-V virtual machines on a regular basis.
Do let us know your thoughts about how to Assign Static IP to Hyper-V virtual machine in the comment section below.