How to configure multiple gateways

Page 1 of 2 12 LastLast

  1. Posts : 3
    Windows 7
       #1

    How to configure multiple gateways


    I have 2 routers, 192.168.0.1 and 192.168.0.10. Computers are assigned IP address through DHCP with 192.168.0.1 as the default gateway. 192.168.0.10 is a test router to test different rules than what are set on the 192.168.0.1 router.

    For me to test, I usually just set the default gateway as static in the IP properties on my windows XP machine. Now that I have a windows 7 machine, when I set the default gateway and do ipconfig, both 192.168.0.1 and 192.168.0.10 are listed. When I do a tracert, it goes through the 192.168.0.1 router.

    How do I get Windows 7 to use the static gateway of 192.168.0.10?
      My Computer


  2. Posts : 3
    Windows 7
    Thread Starter
       #2

    Update:

    I can do route delete 0.0.0.0 mask 0.0.0.0 192.168.0.1 and that removes the DHCP assigned default gateway.

    However, when you /release and /renew the 192.168.0.1 default gateway gets added back in.

    So why is the DHCP assigned gateway overriding the static assigned gateway?

    This was never a problem on my XP machine.
      My Computer


  3. Posts : 77
    Windows 7 & 8 64-bit, Mac OSX 10.8.2
       #3

    If the adapter is getting its addresses automatically by DHCP then, on running ipconfig /renew I would have expected it to get the Default Gateway address allocated by whichever router's DHCP server it is getting its other addresses from.

    Is there any reason for not using fixed IP addressing in the TCP/IPv4 Properties of the network adapter? That way, it wouldn't be getting any addresses from a DHCP server and the Default Gateway would remain as you entered it.

    ...or am I missing something? I have two routers that I use regularly, but they are in different Subnets - 192.168.1.0 and 192.168.3.0
      My Computer


  4. Posts : 3
    Windows 7
    Thread Starter
       #4

    mgmcc said:
    If the adapter is getting its addresses automatically by DHCP then, on running ipconfig /renew I would have expected it to get the Default Gateway address allocated by whichever router's DHCP server it is getting its other addresses from.

    Is there any reason for not using fixed IP addressing in the TCP/IPv4 Properties of the network adapter? That way, it wouldn't be getting any addresses from a DHCP server and the Default Gateway would remain as you entered it.

    ...or am I missing something? I have two routers that I use regularly, but they are in different Subnets - 192.168.1.0 and 192.168.3.0
    Both routers are in the same subnet. One is a test router/firewall. We make changes to that firewall first before implementing them to everyone.

    So what I have is:
    Gateway A - 192.168.0.1 - regular firewall/gateway
    Gateway B - 192.168.0.10 - test firewall/gateway

    Every now and then, if a change or update to the server or firewall needs to be done, we patch/update/change the test firewall first. So I set a static gateway in my TCP properties to 192.168.0.10. I used to be able to do this in XP, but now that I have a Windows 7 computer, when I make the change, I'm still going through the 192.168.0.1 gateway. The only way to force it to go through 192.168.0.10 is for me to do route delete 0.0.0.0 mask 0.0.0.0 192.168.0.1. But having to do this each time I want to go through the 192.168.0.10 gateway is rather annoying, given that I never had to do this with the XP machine.
      My Computer


  5. Posts : 79
    Windows 7 Ultimate x64
       #5

    I've just tried this very thing in the hope I could find a solution for you, but instead I ran into the same issue.

    I first tested with Windows XP:
    Configured TCP/IP > Advanced > added in a manual default gateway with a metric of 1
    Applied
    Ran route print and this showed the DHCP assigned default gateway had been removed
    So I can confirm all works as you want it with Windows XP

    Next I tried with both a Vista and 7 machine:
    Configured TCP/IP > Advanced > added in a manual default gateway with a metric of 1
    Applied
    Ran route print but this showed the DHCP default gateway had a lower metric than the one I manually assigned in the "Active Routes"
    The manually configured gateway has a metric of 1 listed under Persistent routes and a metric of 39 under the list of active routes.

    I beleive the problem lies with Windows trying to be too clever for it's own good. Windows will assign a lower metric to the gateway it can communicate fastest with, which is all fine and dandy if you want two gateways to be used for failover but not much use any other time.

    However I'm unable to find a fix for this documented anywhere, the only workaround I can provide is what you have already mentioned by deleting the route to the DHCP assigned gateway.

    I'd be very interested to find a fix for this, I'll see if I can get hold of MS :)
      My Computer


  6. Posts : 1,020
    Windows 7 Ultimate 64 bit
       #6

    Have you tried setting both default gateways in the Advanced TCPIP setings and adding manual Metric's for both.

    If memory serves me correct the lower number metric should be the first choice; you should be able to add and remove them quickly or from batch file with the 'route add' and 'route delete' commands.
      My Computer


  7. Posts : 79
    Windows 7 Ultimate x64
       #7

    If I add both default gateways in the list the one that is assigned by DHCP still takes precedence, and if you go back in to Advanced TCP/IP settings the address that's assigned by DHCP is removed from the list of statics. So you can't override the metric of the gateway assigned by DHCP by adding it in as a static with a higher metric.
      My Computer


  8. Posts : 1,020
    Windows 7 Ultimate 64 bit
       #8

    BTW - This may or may not help.

    I found a script a few years ago to swap between static and DHCP address (includes changing of the default gateway). I used to use it until I discovered the alternate configuration tab. I've attached it in case it helps your scenario, happy to assist you in editing it if needed.
    How to configure multiple gateways Attached Files
      My Computer


  9. Posts : 1,020
    Windows 7 Ultimate 64 bit
       #9

    DC187 said:
    If I add both default gateways in the list the one that is assigned by DHCP still takes precedence, and if you go back in to Advanced TCP/IP settings the address that's assigned by DHCP is removed from the list of statics. So you can't override the metric of the gateway assigned by DHCP by adding it in as a static with a higher metric.
    Nasty! That's not playing fair. I need to think on this.
      My Computer


  10. Posts : 79
    Windows 7 Ultimate x64
       #10

    Thanks Tim, thats a second workaround.

    I have contacted MS asking if there is a way to regain the behaviour of XP as it works a treat. Will update the thread if I get any useful reply.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:02.
Find Us