2 NICs, 2 Networks, 1 PC - how?

stevecon59

Distinguished
Apr 6, 2011
11
0
18,510
Hi,

I have 2 networks and 2 WiFi routers. Router #1 uses DHCP and assigns a local IP address in a range of 192.168.1.10 - 50 on LAN ports & 5Ghz radio on SSID: "MyNetwork". Router #2 has been flashed with DD-WRT. It loads a VPN service for all devices connected to it. It uses DHCP to assign local IP addresses in a range of 192.168.1.100 - 150 on LAN ports and 2.4Ghz radio on SSID: "MyVPN". My PCs have a dual band WifI adapters. I simply select the SSID of either the VPN or non-VPN WiFi - depending on if I'm connected to a site or service (Netflix) that balks at VPN usage or if I'm just online and wish to be anonymized.

The above seems to work OK - but I'd prefer to do this with (2) wired NICs in the PCs instead. I assume all the hardware work consists of running a cable between each router and NIC; which is easy enough to do. The question is how to go about switching NICs to force traffic through my VPN or non-VPN router as needed - and if any configuration changes are need.

Thanks!
 
Solution
This is similar to what I run, it would be nice if you could just use VPN all the time.

There really is not a lot of difference between wired and wireless in how you accomplish this. Although you can use 2 physical network they must be assigned different subnets not just different DHCP scopes. It can be done with a single nic though depending on why you have the network separate.

What is simpler...well not that this project is simple...is to let your router that you use most the time be the main router with DHCP enable. Assign it say 192.168.1.1. Now connect both routers together lan-lan making sure the dhcp is disabled in the secondary router. Assign the ip 192.168.1.2.

Now the not so simple part. To change services use...

Ralston18

Titan
Moderator
With both wired NICs in the same (your PC)?

Seems to me that you would just enable the NIC for the VPN router or the NIC for the non-VPN router as needed and disable the other NIC.

For the most part there is only one active NIC in a computer unless some bridging is being used. And your computer may already have one wired NIC (built into the motherboard) and a second wired ethernet adapter via a PCI-x slot or even a USB-RJ45 adapter.

Purchasing two identical ethernet adapters may make the configuration process a bit more straightforward. Use ethernet adapters made by the same manufacturer as the respective routers if the routers are different.

And do sketch out a diagram to help keep track of the configuration and key settings (IP addresses, subnet masks, SSID, etc.) Will certainly help you plan and configure a workable setup.

 
I would rather keep NICs from different manufacturers so that they can easily be recognized in Network applet. Enable / disable the network you want.

Another option is to have both networks enabled, and use some third-party tool which "binds" an application to a network interface. Then you would use eg Firefox as your everyday VPN-enabled driver, and Chrome for Netflix.

Last but not least: I would rather keep both NICs (and routers) on different networks.
 
This is similar to what I run, it would be nice if you could just use VPN all the time.

There really is not a lot of difference between wired and wireless in how you accomplish this. Although you can use 2 physical network they must be assigned different subnets not just different DHCP scopes. It can be done with a single nic though depending on why you have the network separate.

What is simpler...well not that this project is simple...is to let your router that you use most the time be the main router with DHCP enable. Assign it say 192.168.1.1. Now connect both routers together lan-lan making sure the dhcp is disabled in the secondary router. Assign the ip 192.168.1.2.

Now the not so simple part. To change services use the ROUTE command. You would do route delete 0.0.0.0 mask 0.0.0.0 192.168.1.1 and then do route add 0.0.0.0 mask 0.0.0.0 192.168.1.2

If you want to run both at the same time you can actually route single ip or block of ip. Let say you leave the 0.0.0.0 route to 192.168.1.1 and you want to route ip 123.123.123.123 to the secondary connection. You put in route add 123.123.123.123 mask 255.255.255.255 192.168.1.2

The huge pain in the butt is getting those lists of ip addresses that change all the time it seams. I generally have wireshark running when I am trying to figure this out so I can see what ips are being used.
 
Solution

stevecon59

Distinguished
Apr 6, 2011
11
0
18,510
Hi, it's been quite hectic for me until now and am only now able to get back to this issue. I'm interested in your solution; but am not quite sure about how to find something that would "bind' a browser to a specific interface - do you have a suggestion for such an app / utility?

Thanks!




 

stevecon59

Distinguished
Apr 6, 2011
11
0
18,510
Interesting, this might work within the scope of what I'm trying to do, too. I'll look into it - thanks.



 

stevecon59

Distinguished
Apr 6, 2011
11
0
18,510
I'm going to look into this solution, too. I've never mucked around with any of the network related command lines - other than ipconfig for releasing / resetting IP addresses. I'll look into route - thanks!