How to add a network route to Windows

flag Scope

Adding a network route in a Windows machine.

construction How-to
First you will need to know the following mandatory parameters:
You can then proceed with the following:
  1. Open an elevated command prompt (Run as administrator)
  2. Execute the following command:
  3. route add destination mask netmask gateway

    So if, for example, you want to route traffic for the destination network 172.24.0.0/24 via the gateway 172.16.0.1 you should execute:
    route add 172.24.0.0 mask 255.255.255.0 172.16.0.1

    Note: by default the route is not permanent, meaning it will be lost on the next system reboot. To make it permanent, simply add /p at the end of the command, like this:
    route add 172.24.0.0 mask 255.255.255.0 172.16.0.1 /p


school Further considerations





Article ID: SYS-WIN-0008