add route on windows ??

Xiaowei He 9,906 Reputation points
2020-08-07T06:05:39.293+00:00

Hi there, am new to this forum, and not so frequent admin but called upon to help when things aren't going right. So as you might guess I normally ask help from those up to date with tech. My situation is that a colleagues has only one network point to LAN and is using a WIFI device sort of like a switch/router for the PC and the mobile (utilizing the WIFI) but would like to print from the PC to a network printer on the LAN. can adding a route on the pc access the printer and how. it was my first attempt and i did not get it right even to ping the printer. The Wifi device has the space 192.168.8.0, the LAN 192.168.151.0, so I tried the following

route add 192.168.151.0 mask 255.255.255.0 192.168.8.1 if 1

help, its my way of learning

Ngonyi

Original Case Link:

https://social.technet.microsoft.com/Forums/windowsserver/en-US/d733dc46-c49f-494a-9001-4a42614f26f3/add-route-on-windows-?forum=winserverNIS

Windows Server Infrastructure
Windows Server Infrastructure
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Infrastructure: A Microsoft solution area focused on providing organizations with a cloud solution that supports their real-world needs and meets evolving regulatory requirements.
551 questions
0 comments No comments
{count} votes

Accepted answer
  1. Candy Luo 12,711 Reputation points Microsoft Vendor
    2020-08-07T06:18:38.777+00:00

    Hi ,

    To add a static route to the table, you’ll type a command using the following syntax:

    route add destination_network MASK subnet_mask gateway_ip metric_cost
    So if you wanted to add a route specifying that all traffic bound for the 192.168.151.0 subnet went to a gateway at 192.168.8.1 and you just wanted to use the automatic metric cost, you would use the following command:

    route add 192.168.151.0 MASK 255.255.255.0 192.168.8.1
    

    Then you could use the route print command to look at the table , you’d see your new static route.

    For more details, you could refer to the following article:

    https://www.howtogeek.com/howto/windows/adding-a-tcpip-route-to-the-windows-routing-table/

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    After adding a static route it will be active until the next restart of your Windows PC. To make the route persistent just add the -p option to the command.

    For Example:

    route -p add 192.168.151.0 MASK 255.255.255.0 192.168.8.1
    

    Best regards,

    Candy

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.