1

I have several network cards but for know I need to route all remote connections to one of them. So I added the following route:

route add 0.0.0.0 mask 0.0.0.0 192.168.101.1 metric 1 (where 192.168.101.1 is a default gateway of required network card)

But now local connections to locahost do not work. How can I keep them working?

1

If you want your default route to be a specific NIC, this is accomplished through your Network Connections > Advanced > Advanced Settings... > Adapters and Bindings tab > Connections window (I'm currently on Vista, but is the same area for all OS). You can change the order in which Windows will use the NICs. Just move the NIC you want to the top of the list and that should take care of the default route (as long as you don't have any specific routes that would supersede the NIC order).

You could also add specific route as you have done and possibly adjust the metric if there are conflicting routes as Hyppy stated, but you'd also need the -p switch to make the route persistent across reboots. If you use the first method, you shouldn't need to add any routes at all.

2

Up your metric. A metric value determines priority. If your custom route's metric is lower than the route for the 127.0.0.1 destination, then it will route those connections through to your 192.168.101.1 gateway.

3
  • Connection Properties -> Properties on TCP/IP -> Advanced TCP/IP -> at bottom of page is the metric settings.
    – Robert
    Jun 15 '12 at 16:20
  • I was thinking more the metric for the route itself, in the command
    – Hyppy
    Jun 15 '12 at 17:05
  • windows has a specific route for 127.0.0.1 that the new route he added shouldn't conflict with. It will match on the network pattern before looking at the metric.
    – August
    Jun 15 '12 at 17:42

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.