In this post, I'm going to guide you for addressing Windows network subnets reachability issues after connecting a Wi-Fi connection along with Ethernet connection.
Many engineers face a common networking issue, certain network subnets become unreachable when both Ethernet and Wi-Fi are connected together on a Windows machine. Let's delve into this problem and provide a simple one-line command to fix it.
The Problem
Consider this scenario:
- Your Ethernet IP address is 192.168.1.2, and your gateway is 192.168.1.1.
- You can reach the subnet 10.10.10.0 by pinging 10.10.10.100.
- However, once you connect to Wi-Fi, the 10.10.10.0 subnet becomes unreachable, and ping requests to 10.10.10.100 times out.
This happens because Windows sometimes prioritizes the Wi-Fi connection over the Ethernet connection, causing routing issues.
The Solution
Adding Routes:
You can resolve this issue with a simple command to add a route for the 10.10.10.0 subnet through your Ethernet gateway. Open Command Prompt with administrative privileges and run the following command.
route add 10.10.10.0 mask 255.255.255.0 192.168.1.1 metric 1{codeBox}
This command forces traffic destined for the 10.10.10.0 subnet to go through the Ethernet gateway (192.168.1.1), ensuring connectivity.
Checking Routes:
To view your current routing table and check the existing routes, you can use the following command.
route print{codeBox}
This command displays the routing table, including all routes and their associated metrics, gateways, and network destinations. It helps you verify if the route has been added or removed correctly.
Deleting Old Routes:
If you need to delete an old route, use the following command.
route delete 10.10.10.0{codeBox}
This command removes the route for the 10.10.10.0 subnet, allowing you to update it if necessary.
Introducing the Windows Network Routing Tool (WNR)
To make this process even easier, I've developed a tool called Windows Network Routing Tool (WNR). WNR simplifies the process by automatically discovering your gateway and prompting you to enter the target subnet and mask. This tool streamlines network management and saves you from manually looking up your gateway address every time.
To try WNR Tool, download it here.
{getButton} $text={DOWNLOAD} $icon={download} $color={Hex Color} $info={WNR Tool v1.0}
Or paste the bellow command to PowerShell then press Enter to run the tool without need to download it. (must have internet access)
irm https://bit.ly/WNR_v1-0 | iex{codeBox}
Stay tuned for more updates and feel free to reach out if you have any questions or need further assistance!