TransWikia.com

Default-Gateway preferred over permanent explicit Static Route (Windows Server 2019)

Super User Asked on November 3, 2021

I have a very annoying problem on my windows server.

This Server has multiple interfaces to interact with many different things. Primarily it is a Hyper-V-Server, thus it requires connectivity to multiple networks for different services used by the virtual machines.

Because it’s Hyper-V, it uses Hyper-V-Extensible Interfaces, configured in the Hyper-V-Manager.

The server is also connected to the company network / aka. the internet.
This company network interface is the only one that uses DHCP, so I automatically get IP 10.20.xx.xx / Gateway 10.20.xx.xx / DNS 10.20.xx.xx
(Let’s call this interface ASIX, because it’s an adapter)

There is another interface (let’s call it ETH1) which is connected to a cisco L2/L3, which handles all the routing to the different services or networks.
All of my static routes lead to that router. I removed the default gateway on that interface.

Then there is a last interface (let’s call it ETH0) which is only for switch-management and so forth. It’s a simple vlan connected to all routers/switches. This interface can be ignored, as it is only a local network, without routing or gateways set.

To access the services, I configured ALL necessary routes beyond the ETH1 interface, like so:

route -p ADD 10.1.2.0 MASK 255.255.255.248 172.19.8.100 IF 13
route -p ADD 10.1.3.0 MASK 255.255.255.248 172.19.8.100 IF 13
route -p ADD 10.1.4.0 MASK 255.255.255.248 172.19.8.100 IF 13
route -p ADD 10.1.6.0 MASK 255.255.255.248 172.19.8.100 IF 13
route -p ADD 192.19.8.0 MASK 255.255.252.0 172.19.8.100 IF 13
route -p ADD 192.19.20.0 MASK 255.255.252.0 172.19.8.100 IF 13
route -p ADD 192.19.28.0 MASK 255.255.252.0 172.19.8.100 IF 13
route -p ADD 172.19.8.0 MASK 255.255.255.0 172.19.8.100 IF 13
route -p ADD 172.20.10.0 MASK 255.255.255.0 172.19.8.100 IF 13
route -p ADD 172.20.20.0 MASK 255.255.255.0 172.19.8.100 IF 13
route -p ADD 172.20.30.0 MASK 255.255.255.0 172.19.8.100 IF 13

These routes were all accessible and working fine while I’ve been connected to the company network directly (=> ASIX).

BUT…
For some weird reason, when I switched the ASIX interface to a WLAN-Interface, due to ongoing changes in the company-network, those routes wouldn’t work anymore at all.

Generally, the routes are ALL working correctly from the router 172.19.8.100, so the issue definitly is with the server.

The difference between using the company network directly and the newly connected WLAN-Interface is the WLAN-Router between the server and the company-network.
So before I directly got a company address (10.20.xx.xx), now I’m getting a DHCP address from the router. (192.168.1.x)

And I have no idea why this would make any difference at all, considering that there’s no overlapping networks and everything is "properly configured" from my perspective.
Even the network that is statically configured attempts to go via 192.168.1.0, which it really shouldn’t:

PS C:Windowssystem32> tracert -d 172.19.8.100

Routenverfolgung zu 172.19.8.100 über maximal 30 Hops

  1     2 ms     2 ms     2 ms  192.168.1.1
  2     2 ms     2 ms     2 ms  10.20.215.250

...and so forth, going the wrong way...

When disabling the WLAN/Intranet interface everything works normally again, I just don’t have internet / company access then.

Can anyone tell me if there’s some internal handling of these routes, that work against me?

Windows shenanigans maybe?

I have a hunch that 2 default-gateways are not a "good idea", but I feel like with static routes set in place it shouldn’t matter that much.
Also, I’ve manually set the interface metric, so that the internal network is generally lower (2 vs 50).

UPDATE:

I followed the tip in the comments and removed the second default-gateway leading to the cisco router. (172.19.8.100)
I also set all interface metrics back to automatic again.

The network metric was just a quick attempt to get a workaround, but it didn’t affect the situation at all.

This is what my route print looks like:

PS C:Windowssystem32> route print
===========================================================================
Schnittstellenliste
 17...00 15 5d d7 f1 05 ......Hyper-V Virtual Ethernet Adapter #5
 11...54 b2 03 18 aa 7e ......Hyper-V Virtual Ethernet Adapter #3
 13...54 b2 03 18 aa 7f ......Hyper-V Virtual Ethernet Adapter
 27...6c f0 49 6c 42 6d ......ASIX AX88772C USB2.0 to Fast Ethernet Adapter
  1...........................Software Loopback Interface 1
===========================================================================

IPv4-Routentabelle
===========================================================================
Aktive Routen:
     Netzwerkziel    Netzwerkmaske          Gateway    Schnittstelle Metrik
          0.0.0.0          0.0.0.0      192.168.1.1    192.168.1.121     36
         10.1.1.0  255.255.255.248     172.19.8.100     172.19.8.250     36
         10.1.2.0  255.255.255.248     172.19.8.100     172.19.8.250     36
         10.1.3.0  255.255.255.248     172.19.8.100     172.19.8.250     36
         10.1.4.0  255.255.255.248     172.19.8.100     172.19.8.250     36
         10.1.6.0  255.255.255.248     172.19.8.100     172.19.8.250     36
        127.0.0.0        255.0.0.0   Auf Verbindung         127.0.0.1    331
        127.0.0.1  255.255.255.255   Auf Verbindung         127.0.0.1    331
  127.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    331
       172.19.8.0    255.255.255.0     172.19.8.100     172.19.8.250     36
     172.19.8.250  255.255.255.255   Auf Verbindung      172.19.8.250    291
       172.20.2.0    255.255.255.0   Auf Verbindung      172.20.2.100    281
     172.20.2.100  255.255.255.255   Auf Verbindung      172.20.2.100    281
     172.20.2.255  255.255.255.255   Auf Verbindung      172.20.2.100    281
      172.20.10.0    255.255.255.0     172.19.8.100     172.19.8.250     36
      172.20.20.0    255.255.255.0     172.19.8.100     172.19.8.250     36
      172.20.30.0    255.255.255.0     172.19.8.100     172.19.8.250     36
      172.127.0.0      255.255.0.0   Auf Verbindung       172.127.0.1    271
      172.127.0.1  255.255.255.255   Auf Verbindung       172.127.0.1    271
  172.127.255.255  255.255.255.255   Auf Verbindung       172.127.0.1    271
       192.19.8.0    255.255.252.0     172.19.8.100     172.19.8.250     36
      192.19.20.0    255.255.252.0     172.19.8.100     172.19.8.250     36
      192.19.28.0    255.255.252.0     172.19.8.100     172.19.8.250     36
      192.168.1.0    255.255.255.0   Auf Verbindung     192.168.1.121    291
    192.168.1.121  255.255.255.255   Auf Verbindung     192.168.1.121    291
    192.168.1.255  255.255.255.255   Auf Verbindung     192.168.1.121    291
        224.0.0.0        240.0.0.0   Auf Verbindung         127.0.0.1    331
        224.0.0.0        240.0.0.0   Auf Verbindung      172.20.2.100    281
        224.0.0.0        240.0.0.0   Auf Verbindung      172.19.8.250    291
        224.0.0.0        240.0.0.0   Auf Verbindung       172.127.0.1    271
        224.0.0.0        240.0.0.0   Auf Verbindung     192.168.1.121    291
  255.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    331
  255.255.255.255  255.255.255.255   Auf Verbindung      172.20.2.100    281
  255.255.255.255  255.255.255.255   Auf Verbindung      172.19.8.250    291
  255.255.255.255  255.255.255.255   Auf Verbindung       172.127.0.1    271
  255.255.255.255  255.255.255.255   Auf Verbindung     192.168.1.121    291
===========================================================================
Ständige Routen:
  Netzwerkadresse          Netzmaske  Gatewayadresse  Metrik
         10.1.1.0  255.255.255.248     172.19.8.100       1
         10.1.2.0  255.255.255.248     172.19.8.100       1
         10.1.3.0  255.255.255.248     172.19.8.100       1
         10.1.4.0  255.255.255.248     172.19.8.100       1
         10.1.6.0  255.255.255.248     172.19.8.100       1
       192.19.8.0    255.255.252.0     172.19.8.100       1
      192.19.20.0    255.255.252.0     172.19.8.100       1
      192.19.28.0    255.255.252.0     172.19.8.100       1
       172.19.8.0    255.255.255.0     172.19.8.100       1
      172.20.10.0    255.255.255.0     172.19.8.100       1
      172.20.20.0    255.255.255.0     172.19.8.100       1
      172.20.30.0    255.255.255.0     172.19.8.100       1
===========================================================================

Relevant Network-Information:

10.1.x.0 => Networks accessible via Cisco Router

192.19.x.0 => Networks accessible via Cisco Router

172.20.2.0 => Management Network / Seperate Interface ETH0

172.19.8.0 => Cisco Router / Backbone Network

172.19.8.100 => Cisco Router

172.19.8.250 => Static IP Interface / Interface ETH1

192.168.1.0 => WLAN-Router Network

192.168.1.1 => WLAN-Router

192.168.1.121 => Current Dynamic IP on Interface with GW to WLAN-Router
(In this issue, it doesn’t matter if I’m connected by WLAN or LAN to the Router, it both doesn’t work)

One Answer

This question can best be answered with:

"When complex things don't work, check off the simple things first."

Thomas was completely right about the part with disabling the second default gateway, since I've already had all the static routes configured it wasn't really necessary.

Then on the other hand I was completely wrong about the part that the interface worked. I assumed that it did, because I haven't gotten any errors on it, but also didn't bother to double-check myself.

When looking closely into the interface status, I noticed that I didn't receive any packets at all. I checked again with the cisco router configuration noticed that the port which I want to be connected on, actually is a different one.

This happened during a recent 'cable-management', which incidently happened simultanously with the change to the temporary router. I wrongly assumed that the fault lies within the temporary router.

Everything else in this question actually was correctly configured, except the default-gateway part.

Answered by HackXIt on November 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP