Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: How to configure multiple gateways

16 Dec 2009   #1

Windows 7
 
 
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 System SpecsSystem Spec
.

16 Dec 2009   #2

Windows 7
 
 

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 System SpecsSystem Spec
16 Dec 2009   #3

Windows 7 & 8 64-bit, Mac OSX 10.8.2
 
 

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 System SpecsSystem Spec
.


16 Dec 2009   #4

Windows 7
 
 

Quote   Quote: Originally Posted by mgmcc View Post
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 System SpecsSystem Spec
17 Dec 2009   #5

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
17 Dec 2009   #6

Windows 7 Ultimate 64 bit
 
 

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 System SpecsSystem Spec
17 Dec 2009   #7

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
17 Dec 2009   #8

Windows 7 Ultimate 64 bit
 
 

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.


Attached Files
File Type: rar changeIP.rar (1.0 KB, 882 views)
My System SpecsSystem Spec
17 Dec 2009   #9

Windows 7 Ultimate 64 bit
 
 

Quote   Quote: Originally Posted by DC187 View Post
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 System SpecsSystem Spec
17 Dec 2009   #10

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
Reply

 How to configure multiple gateways





Thread Tools



Similar help and support threads for2: How to configure multiple gateways
Thread Forum
Windows 7 Handing multiple gateways for Internet connection Network & Sharing
Solved Multiple Monitor Issue- how do I configure up/down? Graphic Cards
How to configure router for Remote Desktop access for multiple PCs Network & Sharing
Unable to save Default Gateways in Network Settings! Network & Sharing
How to configure ram? Performance & Maintenance
OEM Configure Customization
Possible to configure a folder to save contents in multiple locations? General Discussion

Our Sites

Site Links

About Us

Find 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 08:46 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33