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.

We have some servers running Windows Web Server 2008. They have two network cards. One with a private IP of the 172.X address space and one with the 10.X address space. The one with the 10.X address space is deactivated.

Both have their own switch and both are connected to a pfesense server.

The network with the 172.X addresses uses 1:1 NAT from pfsense to connect it with the public static IP. So for every private 172.X address we have public IP addresses. Our servers can connect to the Internet and users can connect to the servers. Everything works fine.

But as soon as we activate the second NIC with the 10.X address space, Windows Web Server 2008 isn't able to connect to the Internet anymore.

So I think it is a routing issue.
How can I tell Windows Web Server 2008 to use the 172.X NIC to connect to the Internet?

EDIT:

The following command will work till the dhcp lease of the 10.X NIC gets refreshed or the card gets deactivated and reactivated. Then I need to enter the command again:

route -p delete 0.0.0.0 mask 0.0.0.0 10.0.1.1

EDIT 2:

Yes, static IPs would make it a lot easier, but the network plan (I cannot change) says private IPs for internal network (10.X) and for internal network (172.X) that is 1:1 NAT to public IPs based on MAC.

My current plan is to use a task that runs the command

route -p delete 0.0.0.0 mask 0.0.0.0 10.0.1.1

every minute or so. And to higher the lease time for DHCP a lot. Do you have other suggestions?

EDIT 3:

When I only use the permanent route, my routing table looks like the following. But it is not working. I can not access the internet with this routing table:

IPv4-Route Table
===========================================================================
    Active Routes:
  Network Destination          Netmask          Gateway        Interface Metric
              0.0.0.0          0.0.0.0       172.16.0.1      172.16.1.30      5
              0.0.0.0          0.0.0.0         10.0.1.1        10.0.1.30      5
             10.0.0.0      255.255.0.0          On-link        10.0.1.30    261
            10.0.1.30  255.255.255.255          On-link         10.0.1.30    261
         10.0.255.255  255.255.255.255          On-link         10.0.1.30    261
            127.0.0.0        255.0.0.0          On-link         127.0.0.1    306
            127.0.0.1  255.255.255.255          On-link         127.0.0.1    306
      127.255.255.255  255.255.255.255          On-link         127.0.0.1    306
           172.16.0.0      255.240.0.0          On-link       172.16.1.30    261
          172.16.1.30  255.255.255.255          On-link       172.16.1.30    261
       172.31.255.255  255.255.255.255          On-link       172.16.1.30    261
            224.0.0.0        240.0.0.0          On-link         127.0.0.1    306
            224.0.0.0        240.0.0.0          On-link       172.16.1.30    261
            224.0.0.0        240.0.0.0          On-link         10.0.1.30    261
      255.255.255.255  255.255.255.255          On-link         127.0.0.1    306
      255.255.255.255  255.255.255.255          On-link       172.16.1.30    261
      255.255.255.255  255.255.255.255          On-link         10.0.1.30    261
    ===========================================================================
Persistent Routes:
  Network Destination          Netmask          Gateway  Metric
              0.0.0.0          0.0.0.0       172.16.0.1       1

===========================================================================

It only works when I use the following command:

route -p delete 0.0.0.0 mask 0.0.0.0 10.0.1.1

Without this command it does not work, why?

share|improve this question
    
Do you have a DG configured on both NIC's? –  joeqwerty Feb 1 '12 at 15:51
    
What do you mean by DG? We use a DHCP Server. –  Chris Feb 1 '12 at 16:23
    
I mean Default Gateway. –  joeqwerty Feb 1 '12 at 16:53
    
yes, I have a default gateway on both NIC's. I delete it from the 10.X using the route command. That works fine. But when the NIC gets a new lease (for example by deactivating and activating the NIC) then the default gateway is again in the routing table and internet does not work. Just choosing other permanent metrics does not help. If you know how to solve this, I will accept YOUR answer. –  Chris Feb 1 '12 at 17:01
2  
How about configuring a static ip address on the server instead of using a DHCP assigned ip address? That's the customary way of configuring servers. –  joeqwerty Feb 1 '12 at 17:09

3 Answers 3

up vote 4 down vote accepted

You'll want to add a persistent route to the routing table for the default gateway of the 172. interface with a lower metric than the route that was added for the 10. interface. Example:

C:\>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 ff ff ff ff ff ...... Intel(R) 82567LM-3 Gigabit Network Connection
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0        10.10.0.1       10.10.0.2       20
          0.0.0.0          0.0.0.0       172.16.7.1     172.16.7.51       30
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
Default Gateway:         10.10.0.1
===========================================================================
Persistent Routes:
  None

I would type the command route -p ADD 0.0.0.0 MASK 0.0.0.0 172.16.7.1 METRIC 1

Source

Re Edit 3:

You need to make the metric lower, not equal. When your routing table has 2 routes with the same metric, windows will load balance across these 2 routes. That means it will send 1 packet out the 172 interface and the next out the 10 interface. This is why you have to delete your other route. Go ahead and make the 172 route persistent with a metric of 1 and you should be all set.

share|improve this answer
    
Just adding a new route does not work. I can use the route command to delete the route to the default gateway to the 10.X interface. But Windows will create a new route when the dhcp lease gets refreshed. –  Chris Feb 1 '12 at 17:04
1  
I think you need to give more information about your DHCP config - why are your 10.X NICs getting config from DHCP? Sounds like you don't want that config so why not use static config on those NICs? –  dunxd Feb 1 '12 at 17:16
    
It is not possible to use static IPs in this environment. The internal IPs of the servers can change very often. –  Chris Feb 1 '12 at 17:34
    
Have you tried adding the route with the lower metric than the 10. route? If you add a persistent route with a metric of 1 windows will always prefer this route over the route installed by DHCP. A look at your routing table would help greatly. –  resmon6 Feb 1 '12 at 20:18
    
I have edited my original post (see Edit3). But it does not work with just a permanent route with a lower metric. –  Chris Feb 2 '12 at 12:14

Have you tried to change the priority order of the NICs on the Advanced Configuration menu?

Under: Control Panel\Network and Internet\Network Connections Press "ALT" Then under Advanced menu;Advanced Settings...

share|improve this answer
1  
You're welcome!!! I'm glad to help. –  Daniel Gouveia de Souza Feb 1 '12 at 17:38
    
hmm, now it doesn't work again, one moment. I will try to figure out why it works and than not. –  Chris Feb 1 '12 at 17:40
    
It works, but Internet is very slow. When I deactivate NIC 10.X it is fast. –  Chris Feb 1 '12 at 17:42
    
There isn't anything left regarding the static routes that you created ? Have you tried resseting the routes how they were? –  Daniel Gouveia de Souza Feb 1 '12 at 17:50
    
currently I have no routes, I have deleted all additional routes and deleted both nics and added them once again. So everything is in a "new" state. I can most sites, most of the times I will get a timeout. But to load a very simple site I need a minute. When I deactivate the 10.X NIC then Internet is with 100MBit (out internet connection). I think that now Windows does a kind of traffic shaping and tries to use both nic, but I don't know. –  Chris Feb 1 '12 at 17:56

Just add a persistent gateway to it:

route -p add 0.0.0.0 mask 0.0.0.0 <ip.of.172.intf's.gateway> 

This is kept over reboots.

share|improve this answer

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.