probably many solutions for this topic but I did not find a satisfying one.
I have a Windows client in network that may be connected wired (199.10) or wireless (199.11). That state is changing dynamically (mobile device), i.e. is wireless, then once plugged it should prefer wired connection (like a regular notebook per default does).
Other clients in the network (e.g. 199.4) shall be able to access this client also shortly after failover.
I tried assigning the same IP address for both wired and wireless network adapters, but Windows gets confused and corrupts the IP configuration then.
Bonding seems to be not an option since the wireless connection is not a dedicated interface.
I tried reaching via hostname but the DNS does not recognize that the client is no longer available and fails to reach the client.
I tried static DNS entry on the router (that could get changed by Tools>Netwatch), but the hostname was not reachable at all - is that maybe because the upstream DNS resolver was used? Can I force to use the router DNS and can I force to query every time or do I need to flush the whole DNS cache?
I would have tried firewall dstnat, but all clients are on the bridge and this should be kept like that if possible.
I did not try bridge dstnat with MAC address - this does not look elegant to me?
I tried editing C:\Windows\System32\drivers\etc\hosts file on 199.4 which works nicely and instantly, but drawbacks are a) works only for this client then, b) IMO not so elegant to edit this file.
You can’t reach your goal by having two DNS records for same name pointing to two IP addresses because that’s not the way DNS works (if there are multiple IP addresses available, then DNS server will round-robin through IP addresses … client will try to connect to one of them and if it fails, it’ll break … this mechanism can be used as kind-of load-sharing and not for fail-over).
What it can be done, though, is to have DHCP server “register” client / address combination with DNS server (ROS can not do it, properly configured proper solutions such as combination of ISC bind / ISC DHCP server on linux or MS AD server can do it) … but with very short TTL value … e.g. 10 seconds. Meaning that when a third party resolves name to IP, it’ll cache address for max 10 seconds. If your client moves from one L2 network to another (e.g. from wired to wireless) and changes IP address, DHCP server will update DNS record with new IP address. If then third party resolves same name in 15 seconds, it’ll get new IP address.
Default is to have much longer DNS record TTL (one hour is usual setting, weeks is not unheard of) and with such long TTL values things clearly fail for a “fast moving target”.
Thank you mkx. I was hoping for a solution in ROS.
I meanwhile also tried the Bridging functionality of network adapters in Windows 10, but it is totally unreliable for fast switching.
It seems that a scheduled task that does periodic ICMP checks and modifies the Windows hosts file dynamically is not a nice, but the best solution.