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
nmg72

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
nmg72

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
mgmcc

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
nmg72

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
DC187

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
TimStitt

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
DC187

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
TimStitt

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, 914 views)
My System SpecsSystem Spec
17 Dec 2009   #9
TimStitt

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
DC187

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
Thread Forum
Possible .bat or program to configure multiple copy(ctrl+c) and paste?
So im doing an email thing where i have to configure multipe emails but alot of them require the same credentials, is there a way to create a .bat, or "software" to be able to copy multiple at one time to avoid having to type it out repeatedly? i.e...... 1) Paswordfortheexample ...
Chillout Room
disable multiple windows of photo viewer. how to configure like XP?
Im sure you all know, but im new to W7. so need some experts help not interested in another photo viewer. I can view any picture I want through acdsee. I like photo viewer. when I click on a picture it opens multiple windows. anyway to configure it to stay in the same window? thank you....
Music, Pictures & Video
Windows 7 Handing multiple gateways for Internet connection
Hi, I have two different Internet Service Provider (ISP). The first ISP router is 192.168.0.1 The second ISP router is 192.168.0.2 I want to know if I set 192.168.0.2 as a secondary default gateway in windows 7 pro. with metric 10. ( Tcp IP properties / advance TAB / bottom add another...
Network & Sharing
Multiple Monitor Issue- how do I configure up/down?
I have a laptop and a separate monitor set up above my laptop. It runs fine but the only problem I have is that when I want to go to my 2nd monitor I have to run the mouse out to the right to go to this screen. As the monitor is placed above my laptop screen it would be more natural to run my mouse...
Graphic Cards
Unable to save Default Gateways in Network Settings!
Hi, I want to save the Default Gateways in Advance TCP/IP Settings for my network adapter. I used the following sequence to set the values: 1. Open Adapter Settings (LAN Properties). 2. Select IPv4 and click on Properties. 3. Click Advance. 4. In the Popup select to add Default Gateways for...
Network & Sharing
Possible to configure a folder to save contents in multiple locations?
Hello. In win 7 is it possible to configure a folder to save it contents across different locations? I want to drop stuff I modify frequently into a folder that will save it on two drives so the files are backed up in case one drive breaks. If not possible please suggest a work around. ...
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 05:10.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App