To configure a static network on Windows Server, assign the IPv4 address, prefix length, gateway, and DNS servers reserved for your VPS. With an elevated PowerShell session and a console fallback ready, the change takes about 10 minutes and leaves you with a repeatable way to check routing and name resolution.
Prerequisites
- A Windows Server VPS running Windows Server 2016, 2019, 2022, or 2025. PowerShell works on Server Core; the graphical path later requires Desktop Experience.
- An active RDP session with a local or domain administrator account, or console access through the VPS control panel. Keep a VNC or console session available before changing a live remote connection.
- The assigned IPv4 address, subnet mask or prefix length, default gateway, and one or two DNS server addresses from your VPSLake service details or support ticket. Do not guess the gateway or reuse values from another server.
- The connected adapter name or interface index, which you will identify in Step 1.
- A VPSLake Windows RDP server if you need a Windows environment for this procedure.
Step 1: Identify the active network adapter
The correct adapter matters on a VPS because virtual Ethernet devices, disconnected adapters, and loopback interfaces can appear in the same list.
Open Windows PowerShell → Run as administrator through RDP or the server console. List connected adapters and their current IPv4 settings:
Get-NetAdapter | Where-Object Status -eq "Up" | Format-Table ifIndex,Name,InterfaceDescription,Status,LinkSpeed
Get-NetIPConfiguration -All | Format-List InterfaceAlias,InterfaceIndex,IPv4Address,IPv4DefaultGateway,DNSServer
Record the ifIndex and Name for the adapter that carries the server’s current connection. A typical result looks like this:
ifIndex Name InterfaceDescription Status LinkSpeed
------- ---- -------------------- ------ ---------
12 Ethernet Microsoft Hyper-V ... Up 1 Gbps
Use the exact adapter name returned by your server. It may be Ethernet, Ethernet 2, or a provider-specific name.
Step 2: Prepare the assigned IPv4 values
Windows PowerShell uses a CIDR prefix length, not a dotted subnet mask, when New-NetIPAddress creates the address.
Write down the values supplied for this VPS, then replace every uppercase placeholder in the following block. For example, a subnet mask of 255.255.255.0 corresponds to prefix length /24, but use the prefix that your provider assigned rather than assuming it.
$InterfaceAlias = "YOUR_INTERFACE_ALIAS"
$IPAddress = "SERVER_IP"
$PrefixLength = [uint8]("PREFIX_LENGTH")
$Gateway = "DEFAULT_GATEWAY"
$DnsServers = @("PRIMARY_DNS", "SECONDARY_DNS")
$InterfaceIndex = (Get-NetAdapter -Name $InterfaceAlias).ifIndex
YOUR_INTERFACE_ALIAS is the adapter name from Step 1. Replace SERVER_IP, PREFIX_LENGTH, DEFAULT_GATEWAY, and the DNS placeholders with the values shown for your service; do not include the slash in the IP address itself.
Step 3: Apply the static IPv4 configuration with PowerShell
Applying the address, route, and DNS settings together avoids a partially configured adapter and uses the built-in Windows networking cmdlets documented by Microsoft.
Run these commands in the same elevated PowerShell window:
Set-NetIPInterface -InterfaceAlias $InterfaceAlias -Dhcp Disabled
New-NetIPAddress -InterfaceAlias $InterfaceAlias -IPAddress $IPAddress -PrefixLength $PrefixLength -DefaultGateway $Gateway -AddressFamily IPv4
Set-DnsClientServerAddress -InterfaceAlias $InterfaceAlias -ServerAddresses $DnsServers
New-NetIPAddress creates the address and default route, while Set-DnsClientServerAddress makes the chosen resolvers persistent instead of relying on DHCP. The commands normally return no error; your RDP session may briefly pause or disconnect if the address changes.
If you are connected over RDP, do not close the console or PowerShell window until the new address has passed the checks in the Verify section. See Microsoft’s New-NetIPAddress documentation and Set-DnsClientServerAddress documentation for the supported parameters.
Step 4: Configure the same values through the GUI
The graphical method is useful on Desktop Experience when you prefer to review each IPv4 field before saving; use it instead of Step 3, not after it.
Open Control Panel → Network and Internet → Network and Sharing Center → Change adapter settings. Right-click the connected Ethernet adapter, choose Properties, select Internet Protocol Version 4 (TCP/IPv4), and choose Properties.
Select Use the following IP address and enter the assigned IP address, subnet mask, and default gateway. Select Use the following DNS server addresses, enter the assigned primary and secondary DNS addresses, and select OK → Close.
Leave Internet Protocol Version 6 unchanged unless IPv6 values were also assigned to this VPS. If Windows displays a network-category prompt after saving, keep Windows Defender Firewall enabled and use the profile appropriate for your server’s security policy.
Verify the static address, route, and DNS
The configuration is complete only when Windows shows a manual address, a default route points to the assigned gateway, and a DNS lookup succeeds.
Run the following in elevated PowerShell, using the variables from Step 2:
Get-NetIPAddress -InterfaceAlias $InterfaceAlias -AddressFamily IPv4 | Format-Table IPAddress,PrefixLength,PrefixOrigin,AddressState
Get-NetRoute -InterfaceIndex $InterfaceIndex -DestinationPrefix "0.0.0.0/0" | Format-Table DestinationPrefix,NextHop,RouteMetric,State
Get-DnsClientServerAddress -InterfaceIndex $InterfaceIndex -AddressFamily IPv4 | Format-Table InterfaceAlias,ServerAddresses
Resolve-DnsName www.microsoft.com
Test-NetConnection -ComputerName www.microsoft.com -Port 443
The address should show PrefixOrigin as Manual, the default route’s NextHop should be your assigned gateway, and the DNS query should return one or more records. A successful outbound test includes:
IPAddress PrefixLength PrefixOrigin AddressState
--------- ------------ ------------ ------------
SERVER_IP PREFIX_LENGTH Manual Preferred
TcpTestSucceeded : True
Finally, test from another network with the server’s public address. Replace SERVER_IP and 3389 with the actual address and RDP port if you changed the default:
Test-NetConnection -ComputerName SERVER_IP -Port 3389
TcpTestSucceeded : True confirms that the public address reaches the RDP listener. It does not mean every application port is open; Windows Defender Firewall still controls inbound services.
Troubleshooting
RDP disconnected after saving the settings
The address, prefix length, gateway, or adapter may be wrong, or another device may already use the address. Open the VPS control panel’s VNC or console session, compare every value with the VPSLake allocation, and correct the configuration there. If the server should return to DHCP temporarily, run this from the console after identifying the adapter:
Set-NetIPInterface -InterfaceAlias "YOUR_INTERFACE_ALIAS" -Dhcp Enabled
Set-DnsClientServerAddress -InterfaceAlias "YOUR_INTERFACE_ALIAS" -ResetServerAddresses
Do not guess a replacement gateway while trying to restore remote access.
New-NetIPAddress reports that the address already exists
The adapter already has that IPv4 address or an older static address is still present. Inspect the current entries before removing anything:
Get-NetIPAddress -InterfaceAlias "YOUR_INTERFACE_ALIAS" -AddressFamily IPv4 | Format-Table IPAddress,PrefixLength,PrefixOrigin,AddressState
If an old address is confirmed and you have console access, remove only that exact address, then rerun Step 3. Replace OLD_SERVER_IP with the address you verified; never remove an entry simply because it looks unfamiliar.
Remove-NetIPAddress -InterfaceAlias "YOUR_INTERFACE_ALIAS" -IPAddress "OLD_SERVER_IP" -Confirm:$false
The IP appears correct, but there is no internet access
A wrong prefix can make the gateway appear unreachable, while a wrong gateway prevents traffic from leaving the local subnet. Compare PrefixLength and NextHop with the values assigned to this VPS, then rerun the Get-NetRoute and Test-NetConnection checks. The gateway must be the provider’s value, not the server’s own IP address.
Public IP tests work, but domain names do not resolve
This is a DNS configuration problem rather than an IP-routing problem. Confirm the resolver addresses with Get-DnsClientServerAddress, then reapply the DNS list from Step 2:
Set-DnsClientServerAddress -InterfaceAlias "YOUR_INTERFACE_ALIAS" -ServerAddresses @("PRIMARY_DNS", "SECONDARY_DNS")
Clear-DnsClientCache
Resolve-DnsName www.microsoft.com
If the query still fails, check that outbound DNS traffic is permitted by local policy and use the DNS servers supplied for the VPS or your organization.
Hardening after the change
- Keep Windows Defender Firewall enabled and review the active profile before allowing any new inbound service.
- Restrict RDP to trusted source addresses or a VPN where practical; a static IP does not make an administrative port safe by itself.
- Save the assigned IP, prefix, gateway, and DNS values in your password manager or infrastructure notes, and keep console access available for future network changes.
- Configure IPv6 separately only when the provider has assigned an IPv6 address, prefix, and gateway.
FAQ
Why use a static IP on a Windows Server VPS?
A static address gives services, DNS records, monitoring systems, and administrators a stable destination. It does not automatically reserve the address with the provider, so use only an address allocated to this VPS.
What is the difference between a subnet mask and a prefix length?
They describe the same IPv4 network boundary in different forms. Windows PowerShell’s -PrefixLength expects the slash notation number, such as 24, while the GUI asks for the dotted mask, such as 255.255.255.0.
Do I need to restart Windows after setting a static IP?
No. The NetTCPIP and DNS client cmdlets apply the settings immediately. You may need to reconnect RDP because changing the address interrupts the existing session, but a server restart is normally unnecessary.
Can I configure IPv6 with this guide?
Not with the IPv4 commands shown here. IPv6 needs its own assigned address, prefix, gateway, and DNS policy; configure it only from the values supplied for the VPS and verify it separately.