Header RSS Feed
 
» IT tipps and howto's

HowTo: Use both wired LAN and wireless LAN (WLAN) connection and use WLAN for Internet Access

Last Update: 15.02.2009

In my apartment there is the problem, that the phone plug is at the entrance of the living room and all my computer devices are in the office room. So I've had two choices: To put the cable through 2 doors and having the cable hanging around or two set up two different internal LAN's. I chose the second choice.

Here an overview of how the network setup looks (click on the image for a bigger picture):

two different lans with one gateway

In the office I'm using a network printer and a NAS device (not listed on the picture) so there is need for a wired network there. Without them, I could have just used the WLAN from the DSL router.

The Problem
When I was at my workstation and plugged the network cable to print a document, I got disconnected from the Internet. Argh! That can't be! I don't want to get disconnected all the time when I want to print something. And: What if I wanna print while I'm online? It's just annoying.

The possible solutions
To solve this problem, there are several possibilites:

1. Use the same IP range for both Networks (WLAN and LAN) and use the Zyxel device as Access Point Relay to forward the WLAN signal from the DSL router. Set an entry in the routing table in the Zyxel device to make a static routing to 192.168.15.1 when accessing anything different than 192.168.20.0/24 (the wired network).

2.Use two different IP ranges and change the routing table in the Zyxel device to add an entry to use the standard gateway 192.168.15.1 for all addresses except 192.168.20.0/24 (the wired network). Even though the Zyxel device cannot see the Netopia device and its LAN range, the client computers get by DHCP this routing settings.

3. Change the priority of the clients to use WLAN before LAN.

There are probably more workarounds, but those were the one coming into my mind at this time.

Trying to work out the solutions
I've tried possible solutions #1 and #2 without success...
First the Zyxel device doesn't successfully forward the WLAN signal from the Netopia device - the relay solution is therefore not possible.
The second solution died because the only thing I was NOT able to change in the routing table of the Zyxel device was the routing for 0.0.0.0 - that means I couldn't set a different primary gateway. Argh! That was actually my plan!

The simpliest and fastest solution - which works!
If you're connected to two different LAN's and you use the command "route print" in the commandline box, you will see the network ip addresses and the corresponding gateway. You will see that your two LAN addresses are in that list. At the end of each row there is a number (Metric). I figured out, the lower this number is, the more important is the routing entry for Windows. By default, the wired LAN connection has a metric of 20, the WLAN connection a metric of 25. In my case, I need to access most IP addresses (the Internet) via WLAN so I have to change the metric for the WLAN connection.
I have found a really good and easy explanation how to do that on the (surprise!) Microsoft Support (KB) website. Here's the link to it: How to change the binding order of network adapters in Windows XP and in Windows 2000. Go to the point "Change the interface metric on a network adapter - that's exactly what I did.

After changing the metric value of my WLAN connection to 15 it was now lower than the metric value of the wired LAN connection (20) and therefore more important in the routing table - from now on I could access Internet and my wired network at the same time without being disconnected.


Go to Homepage home
Linux Howtos how to's
Monitoring Plugins monitoring plugins
Links links

Valid HTML 4.01 Transitional
Valid CSS!
[Valid RSS]

6979 Days
until Death of Computers
Why?