I have a Windows 10 PC that has 2 network interfaces. One of those interfaces goes into the main LAN where the fileserver, dns and the router for the internet are located. The second interface is a tiny LAN which has an PLC and an HMI. They both are physically in the same LAN but on different subnets (sorry, can't change that, outside my control).
So I have two physical interfaces and one logical one: eth0: DHCP, 172.16.x.y, MASK 255.255.255.0, default gw 172.16.x.z eth1: static 192.168.1.158, MASK 255.255.255.0 static 192.168.19.158, MASK 255.255.255.0
The HMI is reachable under 192.168.19.135
Now when I reboot the HMI I start a ping to see when it is reachable again. This should happen after about 30s. But I only get a positive ping reply after 80-90s.
Ping wird ausgeführt für 192.168.19.135 mit 32 Bytes Daten:
Antwort von 192.168.19.158: Zielhost nicht erreichbar.
Zeitüberschreitung der Anforderung.
Zeitüberschreitung der Anforderung.
Zeitüberschreitung der Anforderung.
(sorry for the german text, but I think is should still be clear what we see here) I get another response for the first ping than for the second one.
It seems, that Windows after XP started to do some "routing magic" and just send data out de default route if it can't reach the target on a more specific route. It seems that other also have had this problem
I found some "solutions" that are not real solutions for me (more on that below)
- So ping has a nice "-S" parameter to define the source address. And yes, this "solves" the problem. I get a reply instantly if the HMI is up. But I'm using that command in a powershell-script and the source-parameter to "test-connection" has a completely different meaning. And since I use this in a script this fails as soon as the local IP changes.
- I configured eth0 statically instead of by DHCP and did not define a default route. This also "solved" the problem (i think you can imagine why this is not really a solution)
- I've only theoretically explored this but I could install a linux based router with 3 interfaces between the PC, the LAN and the isolated LAN with the PLC and the HMI and let it do all the routing (this would for sure solve the issue! But honestly, do I need an additional computer just to work around broken windows routing?)
- ´arp -d *´ seems to help too, but need elevated privileges
I've tried adding static routes with different parameters and metrices. No change! Adding the MAC of the HMI statically doesn't help since this MAC can change.
So my questions are:
- is there any documentation on this change of behviour in windows?
- is there a way to force windows to use the defined interface