I have a number of (windows 7) laptops that normally connect via wireless. We also have a wired network for special purposes. When one of these laptops plugs in to the wired network, at the moment, it makes the wired network the default route. Instead, I would like it to keep the wireless network the default, and route only 10...* through the wired. I can achieve this with: route delete 0.0.0.0 IF 22 route add 10.0.0.0 ... IF 22 (where IF 22 is the wired network interface).

But how can I get this to stick? Currently, if the wired network is unplugged then re-plugged, it grabs the default route again. So I want a way of making the wireless network not get the default route, and to make the 10...* network persistent.

Is there a hook to run commands after a network connection is established in windows? In linux I would use post-up hooks.

link|improve this question

65% accept rate
feedback

4 Answers

This probably belongs on Superuser, but I think you just want to add a -p to your ROUTE ADD command to make it persistent.

link|improve this answer
feedback

Perhaps try changing the binding order so that wireless is higher in the list than wired.

http://windows7news.com/forum/general-windows-7-help/how-do-i-change-the-network-binding-order-in-windows-7/msg5234/?PHPSESSID=20008fc86dff21b3f724c3038ee9ce26#msg5234

link|improve this answer
feedback

You can try to change the wireless connexion metric, to an higher metric than your wired connection. This way, your wireless connection default route will always be used if you're connected to the wireless network.

link|improve this answer
feedback
up vote 0 down vote accepted

routing metrics can be changed via Network Sharing centre -> Adapter settings -> (choose connection) -> properties -> TCP/IP v4 -> properties -> advanced -> Automatic Metric

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.