How to configure multiple gateways

nmg72

New member
Local time
9:37 PM
Messages
3
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

OS
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 Computer

OS
Windows 7
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

OS
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

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

OS
Windows 7
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

OS
Windows 7 Ultimate x64
CPU
2x AMD FX-74 @ 3GHz
Motherboard
ASUS L1N64-SLI WS
Memory
4GB
Graphics Card(s)
2x BFG 8800GTX OC
Sound Card
Creative X-Fi Fatal1ty
Monitor(s) Displays
HP L2045w
Hard Drives
2x Samsung Spinpoint
PSU
Enermax 1000W
Case
Armor Extreme ATX
Cooling
Air
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

Computer Manufacturer/Model Number
Custom Hack job
OS
Windows 7 Ultimate 64 bit
CPU
Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
Motherboard
GigaByte EP45-UD3
Memory
8 GB Kingston
Graphics Card(s)
Nvidia GeForce 9600GT
Sound Card
Soundblaster Audigy
Monitor(s) Displays
AOC x2 22"
Hard Drives
2 x Samsung 500GB (RAID)
2 x Samsung 2TB
1 x WD Green 2TB
1 x Seagate 1TB
1 x Samsung 500GB
PSU
Thermaltake QFan 750W
Case
CM Scout Gaming
Cooling
Coolermaster V10
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical 2000
Internet Speed
320
Other Info
Winfast PVR2000CP
LG DVD-RAM DVD/RW/DL Super Multi
Linksys WMP300Nx2 Wireless Adapter
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

OS
Windows 7 Ultimate x64
CPU
2x AMD FX-74 @ 3GHz
Motherboard
ASUS L1N64-SLI WS
Memory
4GB
Graphics Card(s)
2x BFG 8800GTX OC
Sound Card
Creative X-Fi Fatal1ty
Monitor(s) Displays
HP L2045w
Hard Drives
2x Samsung Spinpoint
PSU
Enermax 1000W
Case
Armor Extreme ATX
Cooling
Air
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.
 

Attachments

My Computer

Computer Manufacturer/Model Number
Custom Hack job
OS
Windows 7 Ultimate 64 bit
CPU
Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
Motherboard
GigaByte EP45-UD3
Memory
8 GB Kingston
Graphics Card(s)
Nvidia GeForce 9600GT
Sound Card
Soundblaster Audigy
Monitor(s) Displays
AOC x2 22"
Hard Drives
2 x Samsung 500GB (RAID)
2 x Samsung 2TB
1 x WD Green 2TB
1 x Seagate 1TB
1 x Samsung 500GB
PSU
Thermaltake QFan 750W
Case
CM Scout Gaming
Cooling
Coolermaster V10
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical 2000
Internet Speed
320
Other Info
Winfast PVR2000CP
LG DVD-RAM DVD/RW/DL Super Multi
Linksys WMP300Nx2 Wireless Adapter
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. :confused:
 

My Computer

Computer Manufacturer/Model Number
Custom Hack job
OS
Windows 7 Ultimate 64 bit
CPU
Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
Motherboard
GigaByte EP45-UD3
Memory
8 GB Kingston
Graphics Card(s)
Nvidia GeForce 9600GT
Sound Card
Soundblaster Audigy
Monitor(s) Displays
AOC x2 22"
Hard Drives
2 x Samsung 500GB (RAID)
2 x Samsung 2TB
1 x WD Green 2TB
1 x Seagate 1TB
1 x Samsung 500GB
PSU
Thermaltake QFan 750W
Case
CM Scout Gaming
Cooling
Coolermaster V10
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical 2000
Internet Speed
320
Other Info
Winfast PVR2000CP
LG DVD-RAM DVD/RW/DL Super Multi
Linksys WMP300Nx2 Wireless Adapter
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

OS
Windows 7 Ultimate x64
CPU
2x AMD FX-74 @ 3GHz
Motherboard
ASUS L1N64-SLI WS
Memory
4GB
Graphics Card(s)
2x BFG 8800GTX OC
Sound Card
Creative X-Fi Fatal1ty
Monitor(s) Displays
HP L2045w
Hard Drives
2x Samsung Spinpoint
PSU
Enermax 1000W
Case
Armor Extreme ATX
Cooling
Air
Just to also mention the issue exists on Vista and Server 2008 aswell.
 

My Computer

OS
Windows 7 Ultimate x64
CPU
2x AMD FX-74 @ 3GHz
Motherboard
ASUS L1N64-SLI WS
Memory
4GB
Graphics Card(s)
2x BFG 8800GTX OC
Sound Card
Creative X-Fi Fatal1ty
Monitor(s) Displays
HP L2045w
Hard Drives
2x Samsung Spinpoint
PSU
Enermax 1000W
Case
Armor Extreme ATX
Cooling
Air
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.

Ah good.... (and I read the posts out of order). :)

Good job contacting MS, I look forward to their response.
 

My Computer

Computer Manufacturer/Model Number
Custom Hack job
OS
Windows 7 Ultimate 64 bit
CPU
Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
Motherboard
GigaByte EP45-UD3
Memory
8 GB Kingston
Graphics Card(s)
Nvidia GeForce 9600GT
Sound Card
Soundblaster Audigy
Monitor(s) Displays
AOC x2 22"
Hard Drives
2 x Samsung 500GB (RAID)
2 x Samsung 2TB
1 x WD Green 2TB
1 x Seagate 1TB
1 x Samsung 500GB
PSU
Thermaltake QFan 750W
Case
CM Scout Gaming
Cooling
Coolermaster V10
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical 2000
Internet Speed
320
Other Info
Winfast PVR2000CP
LG DVD-RAM DVD/RW/DL Super Multi
Linksys WMP300Nx2 Wireless Adapter

My Computer

Computer Manufacturer/Model Number
Custom Hack job
OS
Windows 7 Ultimate 64 bit
CPU
Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
Motherboard
GigaByte EP45-UD3
Memory
8 GB Kingston
Graphics Card(s)
Nvidia GeForce 9600GT
Sound Card
Soundblaster Audigy
Monitor(s) Displays
AOC x2 22"
Hard Drives
2 x Samsung 500GB (RAID)
2 x Samsung 2TB
1 x WD Green 2TB
1 x Seagate 1TB
1 x Samsung 500GB
PSU
Thermaltake QFan 750W
Case
CM Scout Gaming
Cooling
Coolermaster V10
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical 2000
Internet Speed
320
Other Info
Winfast PVR2000CP
LG DVD-RAM DVD/RW/DL Super Multi
Linksys WMP300Nx2 Wireless Adapter
I'm hoping to find a solid answer for this as well, we're getting ready to put 7 in production, but have to figure out a clean solution for this first.
 

My Computer

OS
Windows 7
Apologies not getting back with an answer from MS, unfortunately I left the company I was working for, for which I raised the issue against :(
 

My Computer

OS
Windows 7 Ultimate x64
CPU
2x AMD FX-74 @ 3GHz
Motherboard
ASUS L1N64-SLI WS
Memory
4GB
Graphics Card(s)
2x BFG 8800GTX OC
Sound Card
Creative X-Fi Fatal1ty
Monitor(s) Displays
HP L2045w
Hard Drives
2x Samsung Spinpoint
PSU
Enermax 1000W
Case
Armor Extreme ATX
Cooling
Air
Apologies not getting back with an answer from MS, unfortunately I left the company I was working for, for which I raised the issue against :(

@DC187 - Ah well... if I hear anything I'll drop back in and update the thread.... but I'm not holding my breath for MS. ;)

@Flukemeister - What's the end goal that you after and what server OS' are you using? There could be other options for your scenario such as setting different gateways via DHCP for different IPaddress ranges or this solution here.
 

My Computer

Computer Manufacturer/Model Number
Custom Hack job
OS
Windows 7 Ultimate 64 bit
CPU
Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
Motherboard
GigaByte EP45-UD3
Memory
8 GB Kingston
Graphics Card(s)
Nvidia GeForce 9600GT
Sound Card
Soundblaster Audigy
Monitor(s) Displays
AOC x2 22"
Hard Drives
2 x Samsung 500GB (RAID)
2 x Samsung 2TB
1 x WD Green 2TB
1 x Seagate 1TB
1 x Samsung 500GB
PSU
Thermaltake QFan 750W
Case
CM Scout Gaming
Cooling
Coolermaster V10
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical 2000
Internet Speed
320
Other Info
Winfast PVR2000CP
LG DVD-RAM DVD/RW/DL Super Multi
Linksys WMP300Nx2 Wireless Adapter
If you don't like your default gateway by DHCP, you can set to 1 this Registry Setting:

HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\DontAddDefaultGatewayDefault

Then add a new IP gateway in the "advanced graphic setup tcp/ip" and this one will be the first gateway.
 

My Computer

OS
Windows 7 Ultimate x64
Back
Top