1

I have a reoccuring routing problem with Windows 7 Enterprise 64: My LAN ethernet interface is connected to our company network (172.17.0.0/21)) that also offers the default gateway to the internet. The gateway also has routes to another private network within our company (192.168.1.0/24) that I can reach from my PC.

As I have to deal with many different devices on my desk that need to be configured over a web interface without being exposed to the company network. For that reason, I got me a small WiFi access point, disabled its DHCP server, and connected the device (the device is a UMTS router that needs to be configured) to its LAN port. The devices are always set to the address 192.168.1.1 by default, so I set my WiFi interface in Windows to the fixed address 192.168.1.100 and connected to the AP.

When the company network interface is disabled or unplugged, I can reach the device, otherwise I do not reach my device, but the host 192.168.1.1 in the aforementioned other company network via the default gateway. This behaviour is expected, as the default GW takes care and no explicit route to 192.168.1.0/24 exists yet. In order to fix this, I created a permanent route to the network 192.168.1.0/24 over my WLAN interface with a metric lower than the default route:

route add 192.168.1.0 mask 255.255.255.0 192.168.1.100 if 12 metric 5 -p

The default route has the metric 10, so I'm below that, IF 12 is my WLAN interface, -p for permanent route.

Right after setting this route in an admin cmd console, I can access the device and at the same time have internet access. I cannot access the other private company network 192.168.1.0/24, of cource, as the new route intercepts the packets - this is my desired behaviour.

Here's the core problem:

When I restart my machine, I can't reach the device anymore. When I look at the routing table, the route shown above still exists and gets listed in the routing table (as seen with route print), but packets nevertheless go via the default route.

When I then delete the route by hand and then re-set it with the command from above, I instantly can reach the device again.

This is very annoying and unreliable. Why does Windows ignore my route in the first place? What can I do to fix the problem? I don't want to workaround with some batch scripts or similar, to be honest.

  • 2
    “This behaviour is expected, as the default GW takes care and no explicit route to 192.168.1.0/24 exists yet.” But it does. It’s the interface route implicitly added in accordance to the IP address and subnet mask you set. Please provide the output of route print when the “setup” network is connected. – Daniel B Apr 13 '16 at 6:57
0

Sounds like asymmetric routing to me. The target IP does not reply to you via the same path, and sends its replies via its default gateway. Eventually connection tracking cleans up half-established connections on one or other router.

As a work around, consider setting your 192.168.1 network to a /30 or a 255.255.255.252 netmask. That limits you to 2 active IPs (.1 and .2)

Give your laptop 192.168.1.2/30 and the one other device will be reachable at 192.168.1.1

Any other IPs from 192.168.1.4 through .255 will go via. your default gateway.

  • If that doesn't help or make sense, consider drawing a network map showing connections and IPs and netmasks. – Criggie Jan 19 '17 at 3:06

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.