Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 IF 22 route add ... 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

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

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
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

Your Answer


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.