Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Windows Server Box with 2 NICs sitting in 2 Networks with a Gateway Router to a 3rd: e.g.:

A: 10.1.1.0/24 - Remote Network
B: 172.1.1.0/24 - "DMZ" with GW Router to Network A on IP 172.1.1.1
C: 192.168.1.0/24 - Local LAN - Default Gateway 182.168.1.1

NIC1 is in Network B: 172.1.1.5
NIC2 is in Network C: 192.168.1.5 - gets settings via DHCP

I want to have access to/from network A. When I set the default gateway on NIC1 to 172.1.1.1 I can reach network A, but a config with 2 different default gateways is considered problematic/broken.

How to best solve this?

My first intuition was to set a route to network A via the router on network B:

route add 10.1.1.0 mask 255.255.255.0 172.1.1.1

Problems:

  • The route gets ignored. The command answers with OK!, a subsequent 'route print' does not list that route
share|improve this question

1 Answer 1

You can't have two default gateways because it's an oxymoron. Another phrase for Default Gateway would be "Gateway of Last Resort", and two things can't be last.

It may help you visualise this if you remember that Windows routing (And that includes your default gateway(s)) is a global setting for all NICs, IP's and interfaces.

You may need to add the metric and interface option to the command. Please try with those options and then post the results of route print here if that doesn't help. Additionally, if you want this setting to persist across reboots, you will need to add -p after route:

ROUTE -P ADD 10.1.1.0 MASK 255.255.255.0 172.1.1.1 METRIC 1 IF B
share|improve this answer
    
I know that only one of them will be used, its just a lookup in a flat table, it was meant more or less tongue in cheek. –  AndreasT May 17 '13 at 13:02
    
@AndreasT I thought so, given the rest of your post, but I see it on a worryingly common basis! –  Dan May 17 '13 at 13:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.