My Server has two default gateways, one for public IP and the other for Private IP

windows-server-2012-r2

I have set up a server running Windows Server 2012 R2. I have two NIC cards, one I have assigned a Public IP address – 41.223.59.153/30. this one is accessible from the internet.(remote users log in with this) the 2nd is private – 172.18.20.188/24 – this one is only accessible from the LAN users

problem comes because I have two default gateways. when they are both up, I cannot reach the server via the LAN .But I can reach the server via the Internet. when I disable the Public IP address, I can only access via the LAN.

is it possible for me to have them accessible at the same time? it seems the route of the public IP is more dominant. I would appreciate a step by step procedure on that

Thanks

Best Answer

Ideally you should have the default gateway set as a router on your own network to allow communication internally. A firewall box designed to deal with multiple interfaces would be much better suited than a Windows Server box.

However it is possible to specify which adapter to use by using the 'route' command. https://technet.microsoft.com/en-gb/library/bb490991.aspx

Off the top of my head you would set the PC to use the external network card by default but add a command along the lines of this:

route add 10.0.0.0 mask 255.255.0.0 192.168.0.1 metric 2

that basically says "If you want to get to any address that begins 10.0.., then use the gateway 192.168.0.1 and use network interface number 2"

I don't know the IP address conventions for your network so I can't write the specific command, you'll need to do that. I did this in the past for accessing certain internal resources using my wired connection (intranet, exchange server), then random surfing on a WiFi that my company didn't monitor.

Hope this helps.

Edit*

I without specifying that internal traffic HAS to use the correct NIC card, the server will use it's default NIC card and will try to resolve the LAN ip address from it's DNS server, which wont work. In essence right now you can send information to the server, but it doesn't know how to send information back - so it looks like it's timing out when being accessed from LAN. Again, I hope this makes sense.

Related Topic