Solved

Simultaneous connection to Wireless / WiFi & wired LAN

Posted on 2010-08-19
13
1,299 Views
Last Modified: 2012-06-27


I have a laptop which is connected to the wired LAN but whenever I wanted
to use WiFi, I have to detach the wired LAN &  otherwise the WiFi signal
will affected / dropped.  Looks like at any one time only one can be used.

I want to have both connections on at the same time & found the following
thread in EE about tweaking the routing table to enable this:
(I suppose from the article below, since the wired LAN is only for access to a few
 private internal subnets while the WiFi is for numerous subnets access, I should
 set a static route for the wired LAN & a default gateway for the WiFi) :


> XP itself allows you to use wireless and wired connections simultaneously. Are the connections
> physically dropping or is it that you cannot access one  network once connecting to the other
> network? When you are connected to two networks on separate network adapters, you should
> ensure only one adapter has a default gateway or your laptop will get confused where to route
> unknown networks.

> On your wired LAN connection with the static address, remove the gateway.

> Then add a persistent static route for your wired LAN at Windows prompt
>   Start--> Run --> CMD
>   route ADD 172.16.1.0 MASK 255.255.255.0  172.16.13.254 -P
>                              ^destination network                    ^ next hop address (gateway)

> So default gateway have to be substituted with static route (ie persistent route) on the
> wired LAN.  WiFi side (ie WiFi gateway) can't be amended as need to access Internet
> which is a whole lot of subnets out there


Problem is, I'm not able to add the persistent static routes after removing the default
gateway on the wired LAN, regardless of whether I used Class B or C masks :

So how do I fix this to enable simultaneous access.  In the routing tables & "route add"
screen shots below, 192.168.x.y is the WiFi subnets while 172.16.a.b is the wired
private LAN subnets (addresses below sanitized) :




O:\>route add 172.16.0.0 MASK 255.255.0.0 172.16.13.254 -P
The route addition failed: Either the interface index is wrong or the gateway do
es not lie on the same network as the interface. Check the IP Address Table for
the machine.

O:\>route add 172.16.13.0 MASK 255.255.255.0 172.16.13.254 -P
The route addition failed: Either the interface index is wrong or the gateway do
es not lie on the same network as the interface. Check the IP Address Table for
the machine.

O:\>route add 172.16.1.0 MASK 255.255.255.0 172.16.13.254 -P
The route addition failed: Either the interface index is wrong or the gateway do
es not lie on the same network as the interface. Check the IP Address Table for
the machine.


O:\>route add 172.16.0.0 MASK 255.255.0.0 172.16.13.254 -P
The route addition failed: Either the interface index is wrong or the gateway do
es not lie on the same network as the interface. Check the IP Address Table for
the machine.

Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.205.1  192.168.207.172      25
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      169.254.0.0      255.255.0.0  192.168.207.172  192.168.207.172      20
    192.168.205.0    255.255.252.0  192.168.207.172  192.168.207.172      25
  192.168.207.172  255.255.255.255        127.0.0.1       127.0.0.1       25
  192.168.207.255  255.255.255.255  192.168.207.172  192.168.207.172      25
        224.0.0.0        240.0.0.0  192.168.207.172  192.168.207.172      25
  255.255.255.255  255.255.255.255  192.168.207.172  192.168.207.172      1
  255.255.255.255  255.255.255.255  192.168.207.172               3       1
  255.255.255.255  255.255.255.255  192.168.207.172           20005       1
Default Gateway:     192.168.205.1
===========================================================================
Persistent Routes:
  None



===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.205.1  192.168.207.172      25
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      169.254.0.0      255.255.0.0  192.168.207.172  192.168.207.172      20
       172.16.0.0      255.255.0.0    172.16.13.184   172.16.13.184       20
    172.16.13.184  255.255.255.255        127.0.0.1       127.0.0.1       20
   172.16.255.255  255.255.255.255    172.16.13.184   172.16.13.184       20
    192.168.205.0    255.255.252.0  192.168.207.172  192.168.207.172      25
  192.168.207.172  255.255.255.255        127.0.0.1       127.0.0.1       25
  192.168.207.255  255.255.255.255  192.168.207.172  192.168.207.172      25
        224.0.0.0        240.0.0.0    172.16.13.184   172.16.13.184       20
        224.0.0.0        240.0.0.0  192.168.207.172  192.168.207.172      25
  255.255.255.255  255.255.255.255    172.16.13.184   172.16.13.184       1
  255.255.255.255  255.255.255.255    172.16.13.184           20005       1
  255.255.255.255  255.255.255.255  192.168.207.172  192.168.207.172      1
Default Gateway:     192.168.205.1
===========================================================================
Persistent Routes:
  None


When cable connected & mask is 255.255.255.0 :

===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    172.16.13.254   172.16.13.184       1
          0.0.0.0          0.0.0.0    192.168.205.1  192.168.207.172      25
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      169.254.0.0      255.255.0.0  192.168.207.172  192.168.207.172      20
      172.16.13.0    255.255.255.0    172.16.13.184   172.16.13.184       20
    172.16.13.184  255.255.255.255        127.0.0.1       127.0.0.1       20
   172.16.255.255  255.255.255.255    172.16.13.184   172.16.13.184       20
    192.168.205.0    255.255.252.0  192.168.207.172  192.168.207.172      25
  192.168.207.172  255.255.255.255        127.0.0.1       127.0.0.1       25
  192.168.207.255  255.255.255.255  192.168.207.172  192.168.207.172      25
        224.0.0.0        240.0.0.0    172.16.13.184   172.16.13.184       20
        224.0.0.0        240.0.0.0  192.168.207.172  192.168.207.172      25
  255.255.255.255  255.255.255.255    172.16.13.184   172.16.13.184       1
  255.255.255.255  255.255.255.255    172.16.13.184           20005       1
  255.255.255.255  255.255.255.255  192.168.207.172  192.168.207.172      1
Default Gateway:     172.16.13.254
===========================================================================
Persistent Routes:
  None
0
Comment
Question by:sunhux
  • 9
  • 4
13 Comments
 
LVL 5

Accepted Solution

by:
stermeau earned 500 total points
Comment Utility
What is your ip on the wired lan?
I guess it is : 172.16.13.184
You can try to do :
  route add 172.16.0.0 MASK 255.255.0.0 172.16.13.184 -P

Or you can also use the interface number
  route add 172.16.0.0 MASK 255.255.0.0 IF 1 -P
0
 

Author Comment

by:sunhux
Comment Utility

> route add 172.16.0.0 MASK 255.255.0.0 172.16.13.184 -P
Yes, the above works, only after I've connected up the wired LAN cable;
if the cable is not connected, it will give the error below :

C:\> route add 172.16.0.0 MASK 255.255.0.0 172.16.13.184 -P
The route addition failed: Either the interface index is wrong or the gateway do
es not lie on the same network as the interface. Check the IP Address Table for
the machine.

========= connect up cable ===========
C:\> route add 172.16.0.0 MASK 255.255.0.0 172.16.13.184 -P


But it looks like adding the entire subnet of Class B is not good because I'm not able
to ssh to say 172.16.3.5

The routing table now looks as follows :
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.205.1  192.168.207.172      25
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      169.254.0.0      255.255.0.0  192.168.207.172  192.168.207.172      20
       172.16.0.0      255.255.0.0    172.16.13.184   172.16.13.184       1
      172.16.13.0    255.255.255.0    172.16.13.184   172.16.13.184       20
    172.16.13.184  255.255.255.255        127.0.0.1       127.0.0.1       20
   172.16.255.255  255.255.255.255    172.16.13.184   172.16.13.184       20
    192.168.205.0    255.255.252.0  192.168.207.172  192.168.207.172      25
  192.168.207.172  255.255.255.255        127.0.0.1       127.0.0.1       25
  192.168.207.255  255.255.255.255  192.168.207.172  192.168.207.172      25
        224.0.0.0        240.0.0.0    172.16.13.184   172.16.13.184       20
        224.0.0.0        240.0.0.0  192.168.207.172  192.168.207.172      25
  255.255.255.255  255.255.255.255    172.16.13.184   172.16.13.184       1
  255.255.255.255  255.255.255.255    172.16.13.184           30005       1
  255.255.255.255  255.255.255.255  192.168.207.172  192.168.207.172      1
Default Gateway:     192.168.205.1
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
       172.16.0.0      255.255.0.0    172.16.13.184       1



Assuming I have only a handful of Class C subnets, can you give me the exact
"route add" command to add them in (with the persistent static routes must take
precedent before the default gateway, ie after all static routes can't route, then
only last resort is to route through default gateway) :
172.16.10.x
172.16.20.x
172.16.22.x
172.16.4.x
172.16.1.x
172.16.2.x
172.16.16.x
172.16.8.x
172.16.11.x
172.16.14.x
0
 

Author Comment

by:sunhux
Comment Utility

One more question:

by "persistent", does it mean after reboot, those static routes will stay?
If not, will need to place all the "route add ....." commands into a script to run each time
after reboot
0
 

Author Comment

by:sunhux
Comment Utility

Ok, I've made an attempt & yes 172.16.13.184 is my wired LAN's IP addr.





d:\>route delete 172.16.0.0 MASK 255.255.0.0 172.16.13.184 -P
d:\>route add 172.16.2.0 MASK 255.255.255.0 172.16.13.184 -P
d:\>route add 172.16.1.0 MASK 255.255.255.0 172.16.13.184 -P
d:\>route add 172.16.10.0 MASK 255.255.255.0 172.16.13.184 -P
d:\>route add 172.16.20.0 MASK 255.255.255.0 172.16.13.184 -P
d:\>route add 172.16.22.0 MASK 255.255.255.0 172.16.13.184 -P
d:\>route add 172.16.14.0 MASK 255.255.255.0 172.16.13.184 -P
d:\>route add 172.16.16.0 MASK 255.255.255.0 172.16.13.184 -P
d:\>route add 172.16.12.0 MASK 255.255.255.0 172.16.13.184 -P
d:\>route add 172.16.4.0 MASK 255.255.255.0 172.16.13.184 -P
d:\>route add 172.16.11.0 MASK 255.255.255.0 172.16.13.184 -P

Now the routing table looks as follows but I still have no luck
accessing (ie ssh) to say, 172.16.2.6

d:\> route print
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.205.1  192.168.207.172      25
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      169.254.0.0      255.255.0.0  192.168.207.172  192.168.207.172      20
       172.16.1.0    255.255.255.0    172.16.13.184   172.16.13.184       1
       172.16.2.0    255.255.255.0    172.16.13.184   172.16.13.184       1
       172.16.4.0    255.255.255.0    172.16.13.184   172.16.13.184       1
      172.16.10.0    255.255.255.0    172.16.13.184   172.16.13.184       1
      172.16.11.0    255.255.255.0    172.16.13.184   172.16.13.184       1
      172.16.12.0    255.255.255.0    172.16.13.184   172.16.13.184       1
      172.16.14.0    255.255.255.0    172.16.13.184   172.16.13.184       1
      172.16.16.0    255.255.255.0    172.16.13.184   172.16.13.184       1
      172.16.20.0    255.255.255.0    172.16.13.184   172.16.13.184       1
      172.16.22.0    255.255.255.0    172.16.13.184   172.16.13.184       1
      172.16.13.0    255.255.255.0    172.16.13.184   172.16.13.184       20
    172.16.13.184  255.255.255.255        127.0.0.1       127.0.0.1       20
   172.16.255.255  255.255.255.255    172.16.13.184   172.16.13.184       20
    192.168.205.0    255.255.252.0  192.168.207.172  192.168.207.172      25
  192.168.207.172  255.255.255.255        127.0.0.1       127.0.0.1       25
  192.168.207.255  255.255.255.255  192.168.207.172  192.168.207.172      25
        224.0.0.0        240.0.0.0    172.16.13.184   172.16.13.184       20
        224.0.0.0        240.0.0.0  192.168.207.172  192.168.207.172      25
  255.255.255.255  255.255.255.255    172.16.13.184   172.16.13.184       1
  255.255.255.255  255.255.255.255    172.16.13.184           30005       1
  255.255.255.255  255.255.255.255  192.168.207.172  192.168.207.172      1
Default Gateway:     192.168.205.1
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
       172.16.2.0    255.255.255.0    172.16.13.184       1
       172.16.1.0    255.255.255.0    172.16.13.184       1
      172.16.10.0    255.255.255.0    172.16.13.184       1
      172.16.20.0    255.255.255.0    172.16.13.184       1
      172.16.22.0    255.255.255.0    172.16.13.184       1
      172.16.14.0    255.255.255.0    172.16.13.184       1
      172.16.16.0    255.255.255.0    172.16.13.184       1
      172.16.12.0    255.255.255.0    172.16.13.184       1
       172.16.4.0    255.255.255.0    172.16.13.184       1
      172.16.11.0    255.255.255.0    172.16.13.184       1
0
 
LVL 5

Assisted Solution

by:stermeau
stermeau earned 500 total points
Comment Utility
Yes persistent means they will still be there after a reboot.
For the extra routes, use the same command, just replace by:
 172.16.X.0 MASK 255.255.255.0 ( where is is 10,20,22 etc ...)
0
 
LVL 5

Assisted Solution

by:stermeau
stermeau earned 500 total points
Comment Utility
Well, that looks good.
Isn't it what you were looking for?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:sunhux
Comment Utility

Yes, I certainly want to routes to be still around after reboot.

Theoretically the Persistent static routes last shown from "route print" above
is what I wanted, but I'm curios, why I'm unable to "ssh" from my laptop to
say a 172.16.2.6 server with the persistent static routes below.

The moment I set my wired LAN's gateway address (ie 172.16.13.254),
I was able to ssh from my laptop to the very same 172.16.2.6 server.
Would tweaking the "Metric" value in the routes help?


Persistent Routes (from the last post above):
  Network Address          Netmask  Gateway Address  Metric
       172.16.2.0    255.255.255.0    172.16.13.184       1
       172.16.1.0    255.255.255.0    172.16.13.184       1
      172.16.10.0    255.255.255.0    172.16.13.184       1
      172.16.20.0    255.255.255.0    172.16.13.184       1
      172.16.22.0    255.255.255.0    172.16.13.184       1
      172.16.14.0    255.255.255.0    172.16.13.184       1
      172.16.16.0    255.255.255.0    172.16.13.184       1
      172.16.12.0    255.255.255.0    172.16.13.184       1
       172.16.4.0    255.255.255.0    172.16.13.184       1
      172.16.11.0    255.255.255.0    172.16.13.184       1
0
 
LVL 5

Assisted Solution

by:stermeau
stermeau earned 500 total points
Comment Utility
You need to define a default GW in order for your computer to send packages to it when it does not know where the real destination is (not in the same lan).
The metrics are used  to "order rules" it is like a weight.
0
 

Author Comment

by:sunhux
Comment Utility

There's certainly a default gateway but it's for the WiFi interface / NIC;
as what the other EE thread mentions, if I have two default gateways
(ie one for wired LAN & one for WiFi), then the computer will be confused.

If I defined a default gateway for the wired LAN, I will lose the WiFi
connection.  So what do I do to get both connections simultaneously?
Looks like the suggestion from the other EE thread did not work
0
 

Author Comment

by:sunhux
Comment Utility


In case there's confusion, just to summarize my requirements :
if I'm trying to access 172.16.x.y, then it should go thru the wired LAN &
if I'm trying to access any other subnets, then it should go thru the WiFi

With both the WiFi & wired LANs connected at the same time, I need to
be able to access both the Wifi side as well as the internal private LAN
side
0
 

Author Comment

by:sunhux
Comment Utility

Or should I enable Windows ICS besides the Persistent static routes?
Refer to attached screen & if so, which options should I enable/select
ICSRoutescrdmp.jpg
0
 

Author Comment

by:sunhux
Comment Utility

This link below describes quite well what I wanted & someone in that link/thread
mentioned about using "net change" but I don't think there's such a command at
Windows command prompt :

http://www.astahost.com/info.php/connect-wireless-wired-line_t12871.html
0
 

Author Comment

by:sunhux
Comment Utility

In Unix, this is called "multi-homing" but the attempts I've made earlier (ie adding
Persistent static routes) did not help enable "multi-homing" so far on my Win XP
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Resolve DNS query failed errors for Exchange
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now