Windows 7 keeps adding default route to all network interfaces
Greetings.
I am using my Windows 7 Enterprise laptop with both wired and wireless connection turned on. For most of the time, I only use wired to access my network services and internet (via proxy) and it works well. When I need unrestricted net access, I simply remove
the default route for my wired network, as shown below:
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.222.96.1 10.222.96.43 20 <---- Wired (dhcp)
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.23 25 <---- Wireless (dhcp)
...
> route delete 0.0.0.0 mask 0.0.0.0 10.222.96.1
Ok!
After which I am still able to access most network services, while internet traffic is routed through the wireless network. (After disabling proxy).
My problem is this:
After I leave the laptop in such a configuration for some time (screensaver or sleep mode is active), the default route for wired network is back after resuming. This causes me some annoyance, as I must reopen administrative command prompt and retype the
route delete command if I wish to continue using internet via wireless network.
I am guessing that the DHCP client renews its address upon waking from sleep, which causes the route table to be updated. Is there a way to prevent this in this specific instance? (User manually deleted the route - it should stay deleted until the user connects
to a different network, issues an ipconfig /renew command or re-adds the route).
Static IP addresses are not an option, as I tend to move between different subnets on my wired network.
It seems like a minor issue, but it I find it annoying if my operating system tries to help me too much.
Thanks,
November 23rd, 2010 8:43am
I haven't tried, but I guess you could make the cost of the wireless less than the wired to make it the preferred interface.
Try: route -p add 0.0.0.0 mask 0.0.0.0 192.168.0.23 metric 1
The "-p" makes the route persistent even when booted.
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2010 9:28am