Question Locked

route wan traffic and lan traffic to seperate nics

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have 2 nics, one wired and one wireless. The LAN I am on is heavily subnetted so I need to have a default gateway set on it. The wireless nic connects to an internet only hotspot. What I need to do is set up my routing table so that wan traffic only uses the wireless hotspot and lan traffic (AD authentication, RDP, etc.) all gets routed over the nic connected to the LAN. This has turned out to be much harder than I thought.

Here is what I have tried so far. when I looked at the route tables for 0.0.0.0 it shows two default routes, one for each nic. The LAN nic is set at a cost of 20, and the wireless is set at a cost of 25. I added a static route for all traffic going to 172.0.0.0 to use the lan nic with a metric of 10. Then I lowered the metric on the wireless default route to 15. I was hoping this would take care of the problem but it didn't. Interet traffic was definately going over the wireless card, but lan traffic wasn't going anywhere (I think it was attempting to use wireless), and my system bacame unstable to the point where I couldn't even execute a route print command without freezing the workstation. I've also tried just lowering the metric of the wireless adapter to 15 with no other changes and the exact same thing happens. Does anyone know what I'm doing wrong? This is driving me crazy!

5 replies

by robo_dev

By default, Windows is designed to work on a single interface at a time....the interface metrics are there to allow the PC to switch between the faster/slower interface, not to operate them both at once. Operating both at the same time requires a router, which does not exist in most versions of Windows, by default.

Depending on the OS, you can enable simple routing in the workstation.

In Windows XP, for example, there is a registry hack to do this.

Your problem is that when Windows identifies the interface with the lowest routing metric, the default gateway becomes that interface.

You need to enable routing, set your default gateway to point to the LAN, and then set your proxy settings in your browser to the IP address of the wireless interface.

by rhuarch

I am indeed using windows. Do I actually need the registry hack or could I just set the proxy in Firefox to my wireless interface?

(edit) Ok so I tried it and it looks like I really do need to use the reg hack. I have set the bit in the appropriate reg key to 1 but it still isn't working after reboot. Any idea if there is additional setup required to make it work after XP is enabled for routing and proxy is set to the ip of the wireless interface?

by rhuarch

In case anyone ends up looking for this same answer I got it working finally. Here is what I had to do.

1. Added a new static route:
route add 172.0.0.0 mask 172.0.0.0 172.18.74.1 metric 5 if 3

2. Then I raised the metric of the default route for my wired interface:
route change 0.0.0.0 mask 0.0.0.0 172.18.74.1 metric 25 if 3

3. Then (metric was already 25) I lowered the metric of my wireless interface to 20:
route change 0.0.0.0 mask 0.0.0.0 172.18.253.2 metric 20 if 2

4. I had also enabled IP routing in the registry, but I'm not sure if that was a factor in the success of this method.

After these changes everything works perfectly All internal traffic (anything with 172 in the first octet) gets routed to the wired interface. Even the local intranet pages work flawlessly. And anything going to any other address gets routed to the wireless interface, i.e. the internet.

note: the command lines I show here do not include the -p switch to make the changes persistent. I would strongly recommend doing everything without the -p switch until you are absolutely certain the changes you are making do what you want them to do. If you make a change that causes your system to slow down or crash you can just restart and it will go back to the original settings.

by robo_dev

Routing may not be necessary

Routing would allow connectivity for PCs on one subnet to get to the other subnet, which might help when sharing a wireless lan printer.

This discussion is closed to new replies.