Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment
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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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