Learn how to configure the network in Windows Server with Hyper-V.
On the High Grade & SCALE ranges, it is not possible to operate additional IPs in bridged mode (via virtual MACs). It is therefore necessary to configure additional IPs in routed mode or via the vRack.
Requirements
- An OVHcloud dedicated server
- Access to the OVHcloud Control Panel
- An Additional IP block of at least /30 routed to vRack
Instructions
Additional IP in routed mode on public network interfaces
Explanations
You need to:
- Set up NIC Teaming.
- Install the Hyper-V and RRAS roles.
- Set up RRAS to act as a router.
Identify Interfaces and Configure NIC teaming
Open Windows Powershell and execute the command Get-NetAdapter
:
In our example:
- The public interfaces are
Ethernet 3
andEthernet 4
. - The private interfaces are
Ethernet
andEthernet 2
.
Now go back to the Server Manager, go to Local Server
, and click Disabled
opposite NIC Teaming
.
On the following page, right-click one of the public interfaces identified earlier and click Add to New Team
.
Next, give your team a name, add the second interface to the team, expand the Additional Properties, set “Teaming Mode” to LACP
, and finally click OK
.
Configure a static IP
To prevent a connection loss on a reboot we will need to configure the IP statically on the team.
Press Windows Key
+ R
to open a “Run” window. Enter ncpa.cpl
and click OK
. This will open your Network Connections control panel.
Right-click on the team that you created and click Properties
.
Next, double-click on Internet Protocol Version 4 (TCP/IPv4)
.
Select Use the following IP address
and insert your Dedicated Server's IP address.
The “Subnet mask” and “Default gateway” will be 255.255.255.255 and 100.64.0.1 as shown below.
For DNS servers, you can choose your own. For our example, we are using 213.186.33.99 and 8.8.8.8.
Once done, click OK
to close the Window, and OK
again to close the adapter properties Window.
Installing the Hyper-V and RRAS roles
Go to the Server Manager and open the Dashboard
, then click on Add roles and features
Go through the Wizard until you reach the Server Roles
section and select Hyper-V
and Remote Access
.
Next, proceed to the Virtual Switches
subsection of Hyper-V
and select the NIC team that you created earlier.
Next, proceed to the Role Services
subsection of Remote Access
and select Routing
.
Finally, proceed to the Confirmation
section, select Restart the destination server automatically if required
, and click Install
.
Creating the virtual switch
With the newest versions of Windows Server, Hyper-V virtual switches on an LBFO-Type Network adapter cluster are deprecated. As such we will need to create the switch manually using Powershell. Run the following command and replace "vSwitch_Name" with the name of your choice and replace "NIC_Team_Name" with the name of the NIC team that you created earlier:
Configure routing and remote access
Open the new application called Routing and Remote Access
, right-click on your server, and choose Configure and Enable Routing and Remote Access
.
Now, choose Custom configuration
and click Next
.
Next, you need to select LAN routing
and then click Next
.
Finally, click on Finish
and then Start Service
on the pop-up that will appear.
Set primary and Additional IP statically on Hyper-V interface
We must now move the IP configuration to the Hyper-V interface.
Press Windows Key
+ R
to open a “Run” window. Enter ncpa.cpl
and click OK
. This will open your Network Connections control panel.
Right-click on your vEthernet Adapter and click Properties
.
Next, double-click on Internet Protocol Version 4 (TCP/IPv4)
.
Select Use the following IP address
and insert your Dedicated Server's IP address.
The “Subnet mask” and “Default gateway” will be 255.255.255.255 and 100.64.0.1 as shown below.
For DNS servers, you can choose your own. For our example, we are using 213.186.33.99 and 8.8.8.8.
Next, click on the Advanced...
button and, in the new Window, click Add...
under IP addresses.
Add your IP address and subnet mask for your additional IP and click Add
.
Once done, click OK
to close the Advanced Window, click OK
again to close the TCP/IPv4 settings, and finally click OK
, to close the adapter properties Window.
Add a static route
Open a command prompt as administrator and run the command route print interface
:
In our example, you will see that our Hyper-V adapter has an ID of 22.
Take note of your Hyper-V adapter then run the command route add -p 192.xxx.xxx.16 mask 255.255.255.255 0.0.0.0 if 22
(replace the IP and interface ID with the one you received).
You should have the result OK!
Configure your VM
Once you create your VM, go to the settings, select Network Adapter
from the left-hand menu, and click Advanced Features
.
Set the MAC address to Static and enter the MAC address of the virtual switch.
Set the Static IP address inside your VM to the Additional IP address.
Your VM should now have internet access.
Configuration example of a client VM on Ubuntu
File contents of /etc/netplan/ip.yaml
:
Additional IP via vRack
Requirements
- a public block of IP addresses in your account, with a minimum of four addresses
- your chosen private IP address range
- a vRack-compatible server
- a vRack service activated in your account
- access to the OVHcloud Control Panel
Explanations
You need to:
- Create an aggregate.
- Create a bridge connected to the aggregate.
Identify Interfaces and Configure NIC teaming
Open Windows Powershell and Execute the command Get-NetAdapter
:
In our example:
- The public interfaces are
Ethernet 3
andEthernet 4
. - The private interfaces are
Ethernet
andEthernet 2
.
Now go back to the Server Manager, go to Local Server
, and click on Disabled
besides NIC Teaming.
On the following page, right-click one of the private interfaces identified earlier and click Add to New Team
.
Next, give your team a name, add the second interface to the team, expand the Additional Properties set “Teaming Mode” to LACP
, and finally click OK
.
Create the virtual switch via Powershell
We will need to create a virtual switch that will link our VMs to the Team that we created.
First, open Powershell as an admin and run the following command. Replace "vSwitch_Name" with the name of your choice and replace "NIC_Team_Name" with the name of the NIC team that you created earlier:
You are now ready to create your VM and configure the network for it.
Once the VM is created go to the Hyper-V Manager and open the settings for your VM. Select Virtual
and then choose your vSwitch, in this case "vSwitchScale."
Create the virtual switch in Hyper-V Manager
We will need to create a virtual switch that will link our VMs to the Team that we created.
First, open the Hyper-V Manager and click on Virtual Switch Manager
.
On this page, make sure you have External
selected and click Create Virtual Switch
.
Now, give your switch a name, choose your new Team adapter, then click Apply
and then OK
.
You are now ready to create your VM and configure the network for it.
Configure a usable IP address
For vRack, the first, penultimate, and last addresses in a given IP block are always reserved for the network address, network gateway, and network broadcast respectively. This means that the first usable address is the second address in the block, as shown below:
To configure the first usable IP address, you must edit the network configuration file as shown below. In this example, we use a subnet mask of 255.255.255.248.
Windows-19 VM network configuration
In this example, enter one of the usable IP addresses in your block as the IP address and the second to last IP in your block as the Default gateway.
Configuration example of a client VM on Ubuntu
Create a vrack.yaml
file under /etc/netplan/vrack.yaml
.
Content of the file /etc/netplan/vrack.yaml
:
For the netplan configuration changes to take effect, you must reboot the VM or run this command:
Go further
For more information and tutorials, please see our other Dedicated Servers support guides or explore the guides for other OVHcloud products and services.
Article Contributor(s):
- Suhail R
- Ashley Osei