1

A laptop using windows-7 is connected to two WIFI connections using a built in wireless card and a USB wireless card.

  • WIFI-1 is a Tenda Router using IP range 192.168.0.*. This router is not supposed connected to internet on purpose.
  • WIFI-2 is a TP Link Router using IP range 192.168.1.*. This router is connected to the internet and needs to provide internet connectivity to the laptop.

Internet works as long as the laptop connects only to WIFI-2 using either the internal or the USB card. When the second card is used to connect to the WIFI-1, internet connectivity is lost in a few seconds. When we ping a website (like www.google.com) it shows that it is trying to ping google using IP 192.168.0.1 which is the router with no internet connectivity.

How do we tell windows always to use a specific connection for internet? We also tried to set a higher priority for the Wireless Card that connects to WIFI-2 by going changing priority under:

Adapter Settings->Advanced

However, it still shows the same behavior. Also tried to move the internet router to a lower IP range in the hope that Windows may try to use it but it didn't work as well.

1 Answer 1

1

OPTION 1: Remove route. You currently have two routes to 0.0.0.0 i.e. default gateway on both interfaces and route print tells something like:

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.0.0    192.168.0.123     10
          0.0.0.0          0.0.0.0      192.168.1.0    192.168.1.156     10

You can

  • remove this route by route DELETE 0.0.0.0 MASK 0.0.0.0 192.168.1.0
  • manually assign an IP for the interface connected to the network without Internet (on interface's TCP/IPv4 settings) and leave Default gateway empty. (This will remove the route permanenty.)
  • configure DHCP server on TP-Link router. On DHCP > DHCP Settings, use empty default gateway. This is network wide solution and works directly on every computer: if there's no route, why use this router as a default gateway for anyone. In your situation, I'd advice doing this.

OPTION 2: Change metric value. It should be lower for the desired Default Gateway.

  • Decrease the metric value of the desired gateway. (Use the IP addresses from route print.)

    route CHANGE 0.0.0.0 MASK 0.0.0.0 192.168.0.0 METRIC 5 IF 192.168.0.123
    
  • Increase the metric value of the gateway you don't want to use:

    route CHANGE 0.0.0.0 MASK 0.0.0.0 192.168.1.0 METRIC 250 IF 192.168.1.156
    
  • Automate one of these by modifying my script for automated metric adjustment.

5
  • Really sorry, I corrected a couple of typos in my question. So to clarify WIFI-2/TP-Link/192.168.1.* is connected to internet and we need to prioritize it. So I believe, we'll need to delete the other route?
    – Aziz
    Commented Apr 25, 2017 at 16:11
  • Unfortunately Tenda Routers have anemic DHCP server configuration options: they will always set themselves as the default gateway, leaving my best advice (working with TP-Link) useless. Otherwise... if I show you how to use a hammer with my right hand, it works exactly the same way even if you happen to be left-handed. You just switch the IP addresses around. Commented Apr 25, 2017 at 19:09
  • Right. So you believe removing the route 192.168.0.0 should help get rid of the problem where it always tries to attempt to access internet through Tenda?
    – Aziz
    Commented Apr 26, 2017 at 10:41
  • Correct, but manually configuring a static IP without default gateway (instead of DHCP) will have a permanent affect. Otherwise you need to remove the route again every time you reconnect. Am I repeating myself?. Commented Apr 26, 2017 at 10:51
  • Got it, yea I didn't fully understand it the first time :)
    – Aziz
    Commented Apr 26, 2017 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .