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.