2

Hi I configured the following persistent routes on my Windows Server.

route -p ADD 10.32.1.40 MASK 255.255.255.255 172.16.8.254
route -p ADD 10.192.1.40 MASK 255.255.255.255 172.16.8.254

They work fine initially, but when I reboot they do not work anymore and no longer show up as an active route. How could this be?

My route print output looks like this

Tracing route to 10.192.1.40
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  10.129.81.11
  2    <1 ms    <1 ms    <1 ms  10.222.129.5
  3    17 ms     4 ms     4 ms  10.48.1.121
  4     1 ms     1 ms     1 ms  10.222.13.13
  5     4 ms     4 ms     4 ms  10.222.13.14
  6     *        *        *     Request timed out.
  7     *        *        *     Request timed out.
  8     *        *        *     Request timed out.
  9     *        *        *     Request timed out.
 10     *        *        *     Request timed out.
 11  PS C:\Users\Administrator> route print
===========================================================================
Interface List
 12 ...00 50 56 bb 76 d2 ...... Intel(R) PRO/1000 MT Network Connection #2
 11 ...00 50 56 bb 47 c4 ...... Intel(R) PRO/1000 MT Network Connection
  1 ........................... Software Loopback Interface 1
 14 ...00 00 00 00 00 00 00 e0  isatap.{B96D2DBB-444E-4452-ADD3-E20B7A534D11}
 13 ...00 00 00 00 00 00 00 e0  isatap.{7D99C8C8-276A-4232-A137-BA84ACBD738D}
 10 ...02 00 54 55 4e 01 ...... Teredo Tunneling Pseudo-Interface
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     10.129.81.10    10.129.81.234    266
      10.10.110.0    255.255.255.0     172.16.6.254     172.16.6.234     11
      10.129.81.0    255.255.255.0         On-link     10.129.81.234    266
    10.129.81.234  255.255.255.255         On-link     10.129.81.234    266
    10.129.81.255  255.255.255.255         On-link     10.129.81.234    266
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
       172.16.0.0      255.255.0.0     172.16.6.254     172.16.6.234     11
       172.16.6.0    255.255.255.0         On-link      172.16.6.234    266
     172.16.6.234  255.255.255.255         On-link      172.16.6.234    266
     172.16.6.255  255.255.255.255         On-link      172.16.6.234    266
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link      172.16.6.234    266
        224.0.0.0        240.0.0.0         On-link     10.129.81.234    266
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link      172.16.6.234    266
  255.255.255.255  255.255.255.255         On-link     10.129.81.234    266
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
      10.10.110.0    255.255.255.0     172.16.6.254       1
       172.16.0.0      255.255.0.0     172.16.6.254       1
       10.32.1.40  255.255.255.255     172.16.8.254       1
      10.192.1.40  255.255.255.255     172.16.8.254       1
          0.0.0.0          0.0.0.0     10.129.81.10  Default
===========================================================================

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    306 ::1/128                  On-link
  1    306 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

According to this post the most specific subnet mask should get priority. Pretty sure I can't get more specific than 255.255.255.255

More information: I can ping the gateway I'm trying to rig

PS C:\Users\Administrator> ping 172.16.8.254

Pinging 172.16.8.254 with 32 bytes of data:
Reply from 172.16.8.254: bytes=32 time=3ms TTL=255
Reply from 172.16.8.254: bytes=32 time=1ms TTL=255
Reply from 172.16.8.254: bytes=32 time=4ms TTL=255
Reply from 172.16.8.254: bytes=32 time=2ms TTL=255

Result of a tracert:

PS C:\Users\Administrator> tracert 10.32.1.40

Tracing route to pen-srv1 [10.32.1.40]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  10.129.81.11
  2    <1 ms    <1 ms    <1 ms  10.222.129.5
  3     1 ms     1 ms     1 ms  172.29.150.10
  4     2 ms     1 ms     1 ms  172.29.150.9
  5     *        *        *     Request timed out.

It keeps jumping to the wrong network.

  • As you can read at the very end of the Article you posted with your first link "persistent routes". ---- That’s all easy enough, but there is one extra little catch. When you add a static route, by default it only lasts until the next time you start Windows. The reason for this is that many companies use a coordinated list of static routes that gets updated fairly often. Rather than adding and updating all those routes on every machine, they just distribute a batch script file that adds the newest routes during Windows startup. This keeps the routing table relatively uncluttered. – konqui Sep 14 '17 at 12:44
  • I made the route persistent using the "-p" parameter. As you can see it is also showing up in the routing table. It's just not in the active routing table. So somehow it is being overruled by one of the other routes. I just have no clue which one. – Gilles Lesire Sep 14 '17 at 12:46
  • 1
    Persistent routes sometimes don't persist and with no explanation. Try to add the interface parameter to the route command. But if the problem still returns, you might consider adding a boot script that reestablishes these routes. – harrymc Sep 17 '17 at 18:26
  • Hmmm indeed, I just removed the persistent route and readded it, after reboot it just functions as it should. The fact that persistent routes not always persist is quite worrying though. I use it to persist a route to the Active Directory Domain Controller. If that route goes out, no more logging in. :/ – Gilles Lesire Sep 18 '17 at 7:10
  • A boot scrip may be an overkill, but is good assurance. – harrymc Sep 19 '17 at 10:16
1

So after trying to play with the subnet masks, interface parameter, change the metrics of the other routes etc, I gave up, removed the persistent routes and wrote a simple batch script wich adds the routes (non persistent) to the routing table on startup of the server.

Sometimes software name is just being software name.

So I created a .bat file with the 2 route ADD commands (without the -p parameter which would make them persistent). Saved that to C:\Windows\System32\GroupPolicy\Machine\Scripts\Startup folder and added the .bat script to the startup scripts.

Contents of the .bat file are simply:

route ADD 10.32.1.40 MASK 255.255.255.255 172.16.8.254
route ADD 10.192.1.40 MASK 255.255.255.255 172.16.8.254

Thanks @harrymc for the suggestions. Bounty awarded!

  • 1
    Had the same problem for months now. Created a bash script to add the routes but didn't bother to remove the permanent flag in case one day they start working as they should. Windows (correctly) says that the routes already exist when trying to add them, but it still kicks them back into life. – Nick Sep 8 '18 at 17:08
0
+50

Persistent routes sometimes don't persist and with no explanation.

Try to add the interface parameter to the route command, but if the problem still returns, you might consider adding a boot script that reestablishes these routes.

  • Awarded the bounty but I'll leave my answer as the correct one since it contains more information. – Gilles Lesire Sep 19 '17 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.