Tuesday, 27 August 2013

How to make routing in windows work with 2 nics without manual modification of the routing tables?

How to make routing in windows work with 2 nics without manual
modification of the routing tables?

At work I my computer has 2 NICs, one of them is connected to a network
with internet connection, the other is not. Both networks are completely
configured (IP, Mask, D. Gateway, DNS servers). (All addresses are
fictional)
NIC 1: Internet Access, D. Gateway is 192.168.138.1
NIC 2: No Internet Access, D. Gateway is 172.16.1.1
If I connect the cables of both NICs I get internet access (NIC 1) but I
stop being able to access the network on the other (NIC 2) I do see the
local subnet, but I can not get beyond the gateway.
I know that is easy to fix, I simply added route using the command:
route add destination mask gateway
If for example I want to access 10.10.1.3 and I can not, I just write
route add 10.10.1.0 255.255.255.0 172.16.1.1
And that is all, it works!
The thing I do not get, is... once you know this command exists it is
really easy to solve this problem, but until then, I was really puzzled as
to why I was not able to reach things in NIC2 when I connected NIC1.
Why Windows does not automatically "guess" the routes and adds them? All
that it would have to do is to iterate the D. Gateways configured in the
NICs and see if by enabling a route using them access is successful... or
no? what is it that limits this from being automatic? is there a setting
somewhere I should be using to avoid manually messing with my routing
tables? or is this an intrinsic limitation of the TCP/IP protocol?

No comments:

Post a Comment