Re: How to switch between WLAN network and LAN network ?



martinca20@xxxxxxxxxxx (Martin Caldwell) wrote in
news:443a923b$0$11061$9b4e6d93@xxxxxxxxxxxxxxxxxxxxxxxxxx:

My laptop has a Centrino CPU with a built-in WLAN. On the other hand
my laptop is connected to a (wired) LAN as well. Through both of them
I can connect the Internet.

However I would prefer to connect the Internet through LAN (because)
this way it is faster. How do I detect which network is used by
default by WinXP when I type an URL into the browser?

How do I tell WinXP to switch to LAN if WLAN is the current
preference?

Martin



Martin,

Both network interfaces are active at the same time ?

That is usually not desirable if they are connected to the same physical
network AND exist in the same subnet.

If the LAN is 192.168.1.0/255.255.255.0 then both cards will be in the
same network. It would be better to disable the one you don't want to use
through the Network Connections Properties. Simply right-click the one to
disable and select disable. Do the same thing to re-enable it when you
want to use that one instead.

Alternately, it's simply a matter of changing the default gateway of the
PC to select the card you want to use. The only issue is that the IP
addresses of each need to be the static to make it easy.

The default gateway is where IP traffic is sent when it is not destined
for the local subnet, the subnet the NIC is located in, AND there is no
pre-defined route for it in the routing table.

When your PC looks at a destination, it first looks to see if it's for
the local subnet. If not, it then checks the routing table to see if
there's a route for it. If not, it doesn't know what the hell to do with
it so it sends it to the default gateway.

You can see all of the route's by opening a cmd prompt and typing:

route print <press enter>

The first one printed should always be the default gateway route, or
0.0.0.0.

These can be changed 'on the fly' with no rebooting required, even back
to Win98 (if done from the command prompt and not the control panel UI).

To switch back and forth between gateways-

In this example, I'm showing 2 NICs with 2 DIFFERENT subnets.

NIC1 Wired LAN - 192.168.1.2/255.255.255.0 Def.GW-192.168.1.1
NIC2 WLAN- 192.168.100.2/255.255.255.0 Def.GW-192.168.100.1

Create 2 .bat files on the desktop. Name one LAN-GW.bat and the other
WLAN-GW.bat.

Open LAN-GW.bat for editing.

Add these 2 lines to it:

route delete 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 192.168.1.1

Save and close the file.

The 192.168.1.1 may be different, it should be set to whatever the wired
LAN gateway is.

Now open WLAN-GW.bat for editing.

Add these 2 lines:

route delete 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 192.168.100.1

(Again, the last IP is the gateway IP for the WLAN, may be different.)

Save and close the file.

Simply execute the .bat file for whichever gateway you want to use.
Running WLAN-GW.bat will get you through the wireless and LAN-GW.bat will
take you through the wired card.

It should work even if both NICs are in the same subnet.

Playing with the routing table, you can also make some of the traffic go
one way and some the other, IF you know the destination IP's.

Regards,

DanS

.



Relevant Pages

  • Re: 2 different routes
    ... you're trying to route a subnet you're in through ... its gateway -- that won't work the way you expect it to. ... gateway of the secondary public network for things that came in on that ...
    (comp.unix.bsd.freebsd.misc)
  • Re: VPN Gateway
    ... Gateway: ... With this configuration i can't ping any of my Lan ip's. ... Since these addresses come from your DHCP server they are in ... To put the remotes in their own subnet you use the static address pool ...
    (microsoft.public.windows.server.networking)
  • Re: VPN Gateway
    ... Your setup can only work by using the VPN server as a proxy for the remote. ... Gateway: ... With this configuration i can't ping any of my Lan ip's. ... the same IP subnet as your LAN machines. ...
    (microsoft.public.windows.server.networking)
  • Re: can an alias address be routed through?
    ... The other interface sis0 has an address of 192.169.1.254 with a subnet ... BUT from the 192.169 network It still doesnt ... If i add a route ... In other words, no matter what your netmask, your gateway ...
    (comp.unix.bsd.openbsd.misc)
  • A fundamental VPN question re: distant subnet routing
    ... a gateway that routes packets to wherever they need to go. ... be to a local host on the same subnet or to the internet (or whatever subnet ... ends of the VPN. ... That's a "legal" route. ...
    (comp.dcom.vpn)