How to Configure a Windows Server 2022 as a Router

Photo of author

By Victor Ashiedu

Published

Read this guide to learn how to configure a Windows Server 2022 server as a router – connecting two separate networks.

Overview and Requirements

Configuring a Windows Server as a router requires two network adapters on the server. One network adapter should be connected to each network that the router will be routing traffic to and from.

For this guide, I am configuring a Windows Server to route traffic to and from my AZ-800 lab (172.16.0.0/24) and my home network (192.168.0.0/24).

The home network has access to the internet. So, the router connects my AZ-800 lab network to the internet while isolating the two networks.

After setting up the Windows Server as a router, the computers in the 172.16.0.0/24 network will use the IP address of the server (172.16.0.1) as their default gateway.

Step 1: Configure Network Adapters

In this section, I will rename the network adapter connected to the 172.16.0.0/24 network as AZ-800-net. Similarly, I’ll rename the network adapter connected to the 192.168.0.0/24 network as home-net.

After that, I’ll configure the TCP/IP settings of each adapter with the configurations shown below:

Network AdapterIP AddressSubnet Mask/Default GatewayDNS Server
AZ-800-net172.16.0.1255.255.255.0172.16.0.12
home-net192.168.0.120255.255.255.0/192.168.0.1192.168.0.80

Step 1.1: Rename the Network Adapters

  1. Open PowerShell or CMD and run the IPConfig command to determine the network adapter connected to each network.

The result of the command shows that “Ethernet 2” is connected to my home network. On the other hand, “Ethernet 3” is connected to my AZ-800 lab network.

Open PowerShell or CMD and run the IPConfig command to determine the network adapter connected to each network.

To rename the network adapters, complete these steps:

  1. From Server Manager, click the Local Server node, then, click the IPv4 address assigned by DHCP link.
Step 1.1: Rename the Network Adapters
  1. From the result of the IPConfig command, I know that that “Ethernet 2” is connected to my home network while “Ethernet 3” is connected to my AZ-800 lab network.

So, I’ll rename “Ethernet 2” to home-net and “Ethernet 3” to AZ-800-net. To rename a network adapter, right-click it and choose Rename.

Rename the Network Adapters in Windows Server 2022 step 2

Step 1.2: Configure the NIC’s TCP/IP

Configure the TCP/IP settings of the net adapters based on the table your created earlier. Here is a copy for your reference.

Network AdapterIP AddressSubnet Mask/Default GatewayDNS Server
AZ-800-net172.16.0.1255.255.255.0172.16.0.12
home-net192.168.0.110255.255.255.0/192.168.0.1192.168.0.80

The fastest way to configure the TCP/IP settings is to run the following PowerShell commands – open PowerShell as administrator.

#Configure IP settings for the "home-net" adapter

Get-NetAdapter -Name "home-net" | New-NetIPAddress -IPAddress 192.168.0.110 -PrefixLength 24 -DefaultGateway 192.168.0.1

#Assign the DNS server to the "home-net" adapter

Get-NetAdapter -Name "home-net" | Set-DnsClientServerAddress -ServerAddress 192.168.0.80

#Configure IP settings for the "AZ-800-net" adapter

Get-NetAdapter -Name "AZ-800-net" | New-NetIPAddress -IPAddress 172.16.0.1 -PrefixLength 24

#Assign the DNS server to the "AZ-800-net" adapter

Get-NetAdapter -Name "AZ-800-net" | Set-DnsClientServerAddress -ServerAddress 172.16.0.12

Step 2: Install the Routing Role

Open PowerShell as Administrator and run the command below to install the Windows Server routing role.

Install-WindowsFeature -Name Routing -IncludeManagementTools -IncludeAllSubFeature

Wait for the role to install and return a confirmation message.

Step 3: Configure the Server as a Router

  1. While logged in to the server you installed the routing role, open Server Manager. If it was already open when you installed the Routing role, refresh Server Manager.
  2. After that, click the Server Manager’s Tools menu and choose Routing and Remote Access.
  1. Then, right-click the Server node and choose Configure and Enable Routing and Remote Access. On the first page of the wizard, click Next.
  1. Then, select Network Address Translation (NAT) option. On the NAT Internet connection page, click on the network adapter that is connected to the internet to select it.
On the NAT Internet connection page, click on the network adapter that is connected to the internet to select it.
  1. Finally, review the settings and click Finish to set up NAT on the selected network adapter. If you receive a warning about the wizard not being able to configure Windows Firewall ports, click OK.
Finally, review the settings and click Finish to set up NAT on the selected network adapter.
 If you receive a warning about the wizard not being able to configure Windows Firewall ports, click OK.

Step 4: Configure Windows Firewall

  1. Search for an open Windows Defebder Firewall. Then, click Advanced settings.
Search for an open Windows Defebder Firewall. Then, click Advanced settings.
  1. Click the Inbound Rules node, then locate the Routing and Remote Access rule group, hold down the shift key and select all. After that, right-click the rules and choose Enable Rule.
Click the Inbound Rules node, then locate the Routing and Remote Access rule group, hold down the shift key and select all

Step 5: Test the Router

To confirm that the router works, I created a VM in the 172.16.0.0/24 network and configured its TCP/IP settings as shown in the screenshot below. As seen in the screenshot, the VM is connected to the internet.

I used the DNS server on the 192.168.0.0/24 network because I had not configured a DNS server on the 172.16.0.0/24 network when I performed this test.
confirm that a Windows Server 2022 router works

To confirm that the VM connects to the intert via the router, 172.16.0.1, see the result of my tracert command. As shown in the result, the connection’s first hop is the router IP address.

Conclusion

Windows Server offers a simple router that you can use to separate your home from your lab network. In this guide, I explained the steps to configure Windows Server 2022 as a router.

Thank you for reading the guide and I hope you found it helpful. If you did, let me know by responding to the “Was this page helpful?” feedback request below.

You may also find the articles in the “Related Articles” section below super helpful. Thanks again for stopping by.

About the Author

Photo of author

Victor Ashiedu

Victor is the founder of InfoPress Media, publishers of Ilifeguides and Itechguides. With 20+ years of experience in IT infrastructure, his expertise spans Windows, Linux, and DevOps. Explore his contributions on Itechguides.com for insightful how-to guides and product reviews.

Related Articles

Get in Touch

We're committed to writing accurate content that informs and educates. To learn more, read our Content Writing Policy, Content Review Policy, Anti-plagiarism Policy, and About Us.

However, if this content does not meet your expectations, kindly reach out to us through one of the following means:

  1. Respond to "Was this page helpful?" above
  2. Leave a comment with the "Leave a Comment" form below
  3. Email us at [email protected] or via the Contact Us page.

Leave a comment

Send this to a friend