0

I want to connect to remote machines. The problem is that I can connect to every machine except one. After some invertigation I found that problem is in route. Here is example:

PS C:\Users\Alex> tracert 172.17.56.66

Tracing route to 172.17.56.66 over a maximum of 30 hops

  1    31 ms     9 ms    12 ms  10.19.64.1
  2     9 ms    14 ms     8 ms  172.17.56.66

Trace complete.
PS C:\Users\Alex> tracert 172.17.56.68

Tracing route to 172.17.56.68 over a maximum of 30 hops

  1    13 ms     7 ms     7 ms  10.19.64.1
  2    10 ms     5 ms     4 ms  172.17.56.68

Trace complete.
PS C:\Users\Alex> tracert 172.17.56.70

Tracing route to 172.17.56.70 over a maximum of 30 hops

  1    <1 ms    <1 ms    <1 ms  192.168.0.1
  2     8 ms    41 ms     7 ms  188.170.9.10
  3    96 ms     1 ms     1 ms  192.168.1.1
  4     1 ms    <1 ms    <1 ms  10.90.40.41
  5     1 ms     1 ms     1 ms  10.90.40.34
  6     1 ms     1 ms     1 ms  10.90.40.32
  7     3 ms     8 ms     2 ms  10.90.35.80
  8     *        *     10.90.35.78  reports: Destination net unreachable.

Trace complete.

I don't know why it handles this IP differently. Here is my route print.

===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.239     35
     10.19.84.212  255.255.255.252         On-link      10.19.84.214    311
     10.19.84.214  255.255.255.255         On-link      10.19.84.214    311
     10.19.84.215  255.255.255.255         On-link      10.19.84.214    311
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
     172.17.56.65  255.255.255.255     10.19.84.213     10.19.84.214     55
     172.17.56.66  255.255.255.255     10.19.84.213     10.19.84.214     55
     172.17.56.67  255.255.255.255     10.19.84.213     10.19.84.214     55
     172.17.56.68  255.255.255.255     10.19.84.213     10.19.84.214     55
     172.17.56.69  255.255.255.255     10.19.84.213     10.19.84.214     55
     172.17.56.72  255.255.255.255     10.19.84.213     10.19.84.214     55
     172.17.56.73  255.255.255.255     10.19.84.213     10.19.84.214     55
      192.168.0.0    255.255.255.0         On-link     192.168.0.239    291
    192.168.0.239  255.255.255.255         On-link     192.168.0.239    291
    192.168.0.255  255.255.255.255         On-link     192.168.0.239    291
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link      10.19.84.214    311
        224.0.0.0        240.0.0.0         On-link     192.168.0.239    291
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link      10.19.84.214    311
  255.255.255.255  255.255.255.255         On-link     192.168.0.239    291
===========================================================================
Persistent Routes:
  None

So after I added it statically (based on 66 and 68 gateway)

route ADD -p 172.17.56.70 MASK 255.255.255.255 10.19.84.213

It worked. But why does gateway detect automatically in other cases, but in this one I should hardcode it?

  • I see you changed your question already, but I was able to see that somehow it picked up the wrong route in the first place. I didn't happen to notice if it was part of the static route or not, but the route looked wrong as it didn't match the other `172.17.56.0/24` routes. How it got that way? Not sure. – Andrew Apr 02 '18 at 17:13
  • The routes on your local machine aren't relevant. It is the next machine, 10.19.64.1, which is routing the packets. You need to look at its routing table. – Michael Hampton Apr 02 '18 at 18:51
  • @Andrew sorry for inconvinience, I have just found my mistake myself and fixed it to make easier to determine real reason. I don't know but thanks to Abu I found that system says that these routes have been added manually while I'm sure I didn't do anything like it. Must examine my programs, for example I'm using OpenVPN and it cause it.. – Alex Zhukovskiy Apr 03 '18 at 15:54

1 Answers1

3

Your default Gateway is 192.168.0.1. So, if there is no Static route, the traffic will go over the default gateway, except for directly connected Networks. In your example above for 172.17.56.70, you want to send the traffic to a different gateway 10.19.84.213. The only way to do this is to add Static route. This is normal behavior.

Abu Zaid
  • 499
  • 2
  • 6
  • But I didn't add any static route to `172.17.56.68`, why then it behaves differently? – Alex Zhukovskiy Apr 03 '18 at 08:33
  • If you look at the output of 'route print', it shows a Static Route for 172.17.56.68 – Abu Zaid Apr 03 '18 at 09:31
  • Well, you are right so I mark an answer. However, I'm still confused why it worked automatically for one address but didn't for another. I didn't touch routes in any way, but there are static routes for 68 and they weren't for 70 until I added manually persistent route. Looks weird. – Alex Zhukovskiy Apr 03 '18 at 10:46
  • 1
    You can run "netsh interface ipv4 show route" and check the Column "Type". If it says manual for 172.17.56.68, then it was done Manually. – Abu Zaid Apr 03 '18 at 12:02
  • You are right, it says "manual". But how can I get source of this `manual` addition? Because I just rebooted my PC and my static route has just dissapeared while these guys are alive. – Alex Zhukovskiy Apr 03 '18 at 15:52
  • Can you share updated route table and ping? – Abu Zaid Apr 03 '18 at 16:20
  • Sorry, but I have just added this route back manually. I have also ran a script that search for `172.17.56.68` in all files on my system, if it is added via some sort of config I should find it. It may take several hours, so I'm back tommorow with results. – Alex Zhukovskiy Apr 03 '18 at 16:29
  • Well, I don't know. Here is complete list of files that contains `68` IP on my PC `C:\Users\Alex\.bash_history` `C:\Users\Alex\.ssh\known_hosts` `C:\Program Files\Git\etc\profile.d\aliases.sh` `C:\Users\Alex\AppData\Local\Google\Chrome\User Data\Default\Preferences` `C:\Users\Alex\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt`. Nothing like config or something... Route print that you demanded: [https://gist.github.com/Pzixel/c40dc44190a473b393b28615f9a1d925](https://gist.github.com/Pzixel/c40dc44190a473b393b28615f9a1d925) – Alex Zhukovskiy Apr 04 '18 at 08:07
  • Doesn't look like any of those are adding route. You can make it persistent if you don't want them to be removed after reboot. – Abu Zaid Apr 06 '18 at 14:58
  • it's seems that there is some remote server which configures routes on my PC. It should be OpenVPN. I considered that it have to be configured locally, but it seems that it persist its config remotely. It exaplains why I didn't find anything on my machine. – Alex Zhukovskiy Apr 13 '18 at 10:17
  • I should have asked this before, so this only happens when you connect to VPN? – Abu Zaid Apr 13 '18 at 11:46
  • I figured out that this routes appears when I connect to VPN only. So the answer is yes, I guess. – Alex Zhukovskiy Apr 15 '18 at 13:50
  • That is normal behavior of VPN clients, they add routes. – Abu Zaid Apr 15 '18 at 17:46
  • Yep, the question was why it does add it for some IPs and doesn't for others. And the answer seems to be "because VPN server is configured so". But I was expecting that it should be configured somewhere locally. So when I didn't find it i was so surprised that I asked this question. – Alex Zhukovskiy Apr 16 '18 at 10:09