How do I change the default interface for internet...


  1. Posts : 71
    DT and LT: Windows 7 and Fedora 14
       #1

    How do I change the default interface for internet...


    Is there a way to get Windows to use a specified adapter as the default internet connection interface? I have tried editing the routing table and made some progress, but the problem is that if I use the command "route -p add 0.0.0.0 MASK 0.0.0.0 192.168.0.1 metric 25 if 13" but if I unplug the adapter that was set to be default (13 specifies my wireless adapter that I want to use for internet by default) if will not allow me to connect on my wired connection (adapter number 11).

    If I have both the wireless adapter and the ethernet cable plugged in, I will by default get my internet access from the ethernet port. The problem with this is that I live in a dorm where wall connections get rate limited if we exceed 2GB in a 24 hour period. I have managed to get a reasonable connection to a campus wifi network across the street (these are not rate limited) but if I have both plugged in, it will default to the dorm connection. I want to make the wifi connection the default connection, and if I have to, use the dorm connection as the fall back (in case I loose the signal).

    I have a theory that if I can make the interface number of the wifi adapter lower than the interface number of the ethernet connection, I will be able to get the computer to use the wifi connection by default. Am I right in this thinking, and if so, how do I do it?

    EDIT: Figured it out. It doesn't matter what the interface number is. Windows will pick whichever connection costs it the least. this is defined by the metric. So all you have to do is change the metric of the desired interface to something that is lower than the metric of the undesired connection and you are good to go. What I wonder is if this means if you made the metrics equal, could you double your speed (ie load balancing)?
    Last edited by freelancer91; 20 Apr 2010 at 19:23.
      My Computer


  2. Posts : 76
    win7
       #2

    the question is what is 192.168.0.1 ?
    is it the IP gateway from your wireless ? If it is, so you're right.
    check your computer routes using "route print"
    and if you want to make it as default set with lowest metric

    eg :
    route add -p 0.0.0.0 mask 0.0.0.0 <wireless gateway IP> metric 0 -> default route
    route add -p 0.0.0.0 mask 0.0.0.0 <wired gateway IP> metric 20 -> secondary route
      My Computer


  3. Posts : 71
    DT and LT: Windows 7 and Fedora 14
    Thread Starter
       #3

    Ok, I think that setting the metrics to be equal will do some sort of load balancing, but not on a packet by packet basis. That would be the holy grail if I could figure out how to do that.....
      My Computer


  4. Posts : 76
    win7
       #4

    Windows can do load balancing also if you set equal metric.
    But i will not do perfectly like router do.
      My Computer


  5. Posts : 1
    Windows 7 32 Bit
       #5

    What you want is just to send your internet traffic to a particular interface, not all your network traffic. Opening a command prompt and using the Route Print command, you'll see a route for your 127.0.0.0 network traffic, which is how Windows views your internet traffic. Type route change 127.0.0.0 mask 255.0.0.0 <gateway> metric 10 if <interface#> press enter. This will direct all your internet traffic to the interface you typed in the command, and leave all your other network traffic to go out their normal interface.

    In Windows 7 you might also see a route for 127.0.0.1 traffic. Repeat the previous command for this route also.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:39.
Find Us