Say that you have two (or more) network cards in your machine. One you want to use for internet access, and the other to access a corporate network but you donโt want to pass any internet traffic that way โ either because there is no route there or itโs censored.
Most people will tell you this is not possible just using Windows, but it very much is. From the command line, you can use the โrouteโ command to add static routes with multiple gateways โ as many as you like, really.
But be careful โ once you start static routing, pretty much every network that you want to reach that is not explicitly defined on some NIC must have a route explicitly declared at the command line.
So to make a static route to the internet, youโd open an administrator command line and type:
route add -p 0.0.0.0 mask 0.0.0.0 172.16.1.1 metric 1
This tells your machine to add a persistent (the -p switch) default route for any traffic that doesnโt match any other network and to route it out via 172.16.1.1, which in this case is the gateway of the router that I want to reach the internet with. This address must be defined also as a gateway on at least one of your NICs. Please note, your specific IP address information might be and almost certainly will be different.
But now you have another problem โ depending on its size and organization, you likely will not be able to reach some corporate resources so you have to add routes for those as well (telling you how to find/figure out those is way beyond the scope of this tutorial).
And that would look something like this:
route -p add 10.106.20.0 MASK 255.255.255.0 192.168.10.126 METRIC 10
This tells any traffic bound for the 10.106.20.0/24 network to use the gateway 192.168.10.126 (which must be defined on at least ones of your NICs).
Iโll admit this isnโt intuitive or easy, but it is very, very useful. Anyone who tells you multiple gateways wonโt work in Windows is full of posh, simple as that.