LAN and WAN over different interfaces/networks

LiLRiceBoi

Golden Member
Dec 2, 2000
1,211
0
0
Is it possible to have all my WAN traffic go over wifi and LAN traffic go over ethernet connection, each connecting to a different router/network?

If so, could someone please explain how. I'm using XP SP2 and Ubuntu 8.04.

Thanks
 

bobdole369

Diamond Member
Dec 15, 2004
4,504
2
0
You would set your routing table to make that happen.

i.e.

route add 192.168.0.0 mask 255.255.255.0 192.168.0.1 if 0x0001
route add 0.0.0.0 mask 255.255.255.255 192.168.1.1 if 0x0002

in ubuntu type "route" to see the routing table. Then type man route to see the nomenclature.

Something along the lines of:
route add -net 192.168.0.0/24 gw 192.168.0.1 if eth0

(probably not exactly right, but close).


This assumes 192.168.0.x is the "LAN" network and that 192.168.1.x is the "WAN" network.

Only nubs use .0 or .1.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
If both your wifi and ethernet are on the same subnet then you'll have issues. If you've got them on different subnets then it should be pretty simple to get it working with some simple routing changes like bobdole369 says.
 

seepy83

Platinum Member
Nov 12, 2003
2,132
3
71
I believe the easiest solution is to set a Default Gateway on the TCP/IP properties of your WLAN card, and no Default Gateway on your regular NIC. In this case (under Windows), Windows will select the Wired NIC as the preferred connection for all traffic, but because there is no Default Gateway, it will choose the WLAN card for all traffic destined for an address on the WAN. This scenario should hold true even if both the NIC and WLAN card are on the same subnet.

Feel free to correct me if you think differently, but I believe this is true.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
This scenario should hold true even if both the NIC and WLAN card are on the same subnet.

No, actually I don't even know what Windows would do if both are on the same segment since you're not supposed to do that. Windows gets confused very easily when it comes to networking and dual-homing a Windows box is always a bad idea.
 

seepy83

Platinum Member
Nov 12, 2003
2,132
3
71
Originally posted by: Nothinman
This scenario should hold true even if both the NIC and WLAN card are on the same subnet.

No, actually I don't even know what Windows would do if both are on the same segment since you're not supposed to do that. Windows gets confused very easily when it comes to networking and dual-homing a Windows box is always a bad idea.

I've done this countless times without error. Remember - by default, Windows assigns a metric of 10 to a Wired NIC and 25 to a Wireless in its Routing Table.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I've done this countless times without error. Remember - by default, Windows assigns a metric of 10 to a Wired NIC and 25 to a Wireless in its Routing Table.

Which means no traffic will hit the wireless if they're both on the same subnet because you can't remove the route for local networks.
 

seepy83

Platinum Member
Nov 12, 2003
2,132
3
71
Originally posted by: Nothinman
I've done this countless times without error. Remember - by default, Windows assigns a metric of 10 to a Wired NIC and 25 to a Wireless in its Routing Table.

Which means no traffic will hit the wireless if they're both on the same subnet because you can't remove the route for local networks.

But if you assign a Default Gateway to the Wireless and don't assign to the Wired, then all traffic destined for the WAN is forced to go through the Wireless, regardless of the metric being 25, because there is no other possible route.
 

drebo

Diamond Member
Feb 24, 2006
7,034
1
81
This just sounds like a steaming pile of horseshit and I cannot even imagine a reason why you would want to do this.

OP, I suggest you look long and hard at what you're trying to accomplish. Chances are, there's a far simpler, easier, and better way to do it.
 

bobdole369

Diamond Member
Dec 15, 2004
4,504
2
0
Here is one reason why we do exactly this - redundancy.

We install networks aboard ships. Megayachts to be exact (>100ft) - they are often "classed" vessels, which means in order to be insured by Lloyds or to belong to the society such as MCA - an absolute necessity if the boat is to be used for private charter - they MUST have a redundant data network. This data network must not fail because a single wire run was indavertently severed.

Thus we install 2 runs to every PC and provide double switches as well. We carefully design the network and use RSTP to control broadcast storms.

Our software has failover built in - thus if the data suddenly stops from one interface, or the whole interface goes down - it is able to communicate on the second network.

 

bobdole369

Diamond Member
Dec 15, 2004
4,504
2
0
The problem I see here is that Windows will seemingly randomly (maybe it does it alphabetically or whichever interface is initialized first) - select an interface to assign the highest metric to the LAN network. That is if there are 2 that are on the same subnet. I have yet to figure out a rhyme or reason to it. Lucky for my companies software - it doesn't matter. Also fortunately the software we use is exclusive and no other apps or services use our network, and there is also no way out.
 

drebo

Diamond Member
Feb 24, 2006
7,034
1
81
Originally posted by: bobdole369
Here is one reason why we do exactly this - redundancy.

We install networks aboard ships. Megayachts to be exact (>100ft) - they are often "classed" vessels, which means in order to be insured by Lloyds or to belong to the society such as MCA - an absolute necessity if the boat is to be used for private charter - they MUST have a redundant data network. This data network must not fail because a single wire run was indavertently severed.

Thus we install 2 runs to every PC and provide double switches as well. We carefully design the network and use RSTP to control broadcast storms.

Our software has failover built in - thus if the data suddenly stops from one interface, or the whole interface goes down - it is able to communicate on the second network.

That's not this situation though. In your network, you're using features of layer 2 and 3 network equipment to provide redundancy and failover in the event of equipment failure. HSRP, STP, LACP, etc. You don't have every network device as part of two different networks (read: subnet) even though they may be tied to two different physical networks.

What the OP is asking for is likely a poorly executed bandaid to something that could be done much better. Though, he doesn't give us any details, so I assume it's something that doesn't really need to be done the way he thinks its supposed to or something that's illegal. I.E. he's trying to steal internet access from his neighbor's unsecured wireless network while still able to share data from one PC to another.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
But if you assign a Default Gateway to the Wireless and don't assign to the Wired, then all traffic destined for the WAN is forced to go through the Wireless, regardless of the metric being 25, because there is no other possible route.

I guess that could work, but it still seems like a lot of hoops for no real benefit.

 

kevnich2

Platinum Member
Apr 10, 2004
2,465
8
76
Can I ask, what is the purpose of this? If your getting your internet from wireless, may be better just get a wireless bridge and connect that to a router's WAN port?
 

LiLRiceBoi

Golden Member
Dec 2, 2000
1,211
0
0
Ok thanks, I think I know how to set this up.

I'm trying to use a nearby free wifi hotspot, but I want my computers to be networked on my own LAN so I can connect to my data server, etc.