Solved

How do I make Windows 7 ignore the DHCP assigned default gateway and use the hard coded gateway?

Posted on 2012-04-02
13
1,772 Views
Last Modified: 2012-06-21
Wer are preparing to roll out Windows 7 to users.  Computers receievthe ir ip address and default gateway through DHCP.  Some users need to go through another gateway which we hard code in.  Regardless of hard coding and setting this gateway to a lower metric - Windows 7 ignores it and continues to use the dhcp assigned gateway.

The only solution I have found so far is using "route add" to set the desired gateway and metric.

Has anyone else run into this?  Is there a better solution?  Thanks.
0
Comment
Question by:LIFEEXPERT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +3
13 Comments
 
LVL 40

Expert Comment

by:Adam Brown
ID: 37797398
How are you hard coding the gateway, out of curiosity?
0
 
LVL 16

Expert Comment

by:uescomp
ID: 37797402
0
 
LVL 21

Expert Comment

by:motnahp00
ID: 37797415
Make a reservation in DHCP for your client.

Right click your reservation -> Configure Options.

Add 003 Router with your preferred GW.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:motnahp00
ID: 37797426
uescomp,

Isn't manually configuring entries with netsh counterproductive to having a DHCP server?
0
 

Author Comment

by:LIFEEXPERT
ID: 37797446
@ ACBrown2010 - in the adapter settings - TCP/IP Properties

@uescomp - Yeah I cam across that article - I'm basically doing that.  Adding the route from a command line (route add 0.0.0.0 mask 0.0.0.0.0 gateway metric -p) which will work but could get cumbersome to keep up
0
 
LVL 21

Expert Comment

by:motnahp00
ID: 37797472
My apologies uescomp. I realized the author may not even be using a DHCP role server.

Try this LIFEEXPERT:

C:\Users\abby>netsh int ipv4 show int

Idx     Met         MTU          State                Name
---  ----------  ----------  ------------  ---------------------------
  1          50  4294967295  connected     Loopback Pseudo-Interface 1
 17          25        1500  disconnected  Wireless Network Connection
 15          10        1500  connected     Local Area Connection
 19          20        1500  connected     VMware Network Adapter VMnet1
 20          20        1500  connected     VMware Network Adapter VMnet8

netsh interface ipv4 set address 15 static 192.168.1.X 255.255.255.0 192.168.1.X
netsh interface ipv4 add dnsserver name=15 address=192.168.1.X index=1
0
 

Author Comment

by:LIFEEXPERT
ID: 37797474
In XP this was easy - the server handed out the ip address and the gateway - then if we wanted to send them out through a less restrictive gateway we just added that gateway to the tcp/ip properties of their network connection.  Windows 7 doesnt seem to care what you put in the or what metric you set - it always grabs the dhcp assigned gateway.
0
 
LVL 40

Expert Comment

by:Adam Brown
ID: 37797546
Are you also listing the Gateway assigned by DHCP in the list of Gateways? Also, do you have IPv6 enabled on your Windows 7 Machine and is your DHCP server handing out IPv6 addresses and gateways? (IPv6 gateway will have a higher preference than IPv4)
0
 

Author Comment

by:LIFEEXPERT
ID: 37797852
Yes - I do a route add on the DHCP gateway as well an assign it a metric of say 40 and make it persistient.  I do not have IPv6 enabled - it is set to prefer IPv4 over 6.
0
 
LVL 16

Expert Comment

by:uescomp
ID: 37798047
Setting a reservation is anotherway but it would be the same as assigning a static onto the system.  You could just reserve a block of addresses then assign reservations or static addresses to those systems like you do to the servers (if you do).
0
 
LVL 12

Accepted Solution

by:
DLeaver earned 400 total points
ID: 37811557
What about seperate class ID's to define the alternate options for the other clients?

Setup the new class id that has the alternate gateway that you want to assign to the other clients and then run the ipconfig /setclassid on the clients that need it (in script form to speed up the process)

http://sourcedaddy.com/networking/implementing-user-classes.html

http://www.techrepublic.com/article/use-dhcp-class-to-deny-internet-access-to-unauthorized-machines/5498436
0
 
LVL 26

Assisted Solution

by:Leon Fester
Leon Fester earned 100 total points
ID: 37812307
You can set different default gateways in the same DHCP server/scope by configuring the options correctly.

Here is the list of scope options available:
http://technet.microsoft.com/en-us/library/cc780705(v=ws.10).aspx
http://technet.microsoft.com/en-us/library/cc958929.aspx

In your scenario, you would need to add options on each Windows 7 reservation.

Alternatively look at setting DHCP based on the vendor or user classid's.
With Vendor classid, you need to have a standard workstation configuration(specifically the make of the NIC) which would need to be different for Windows XP and Windows 7.

How the classes work:
http://technet.microsoft.com/en-us/library/cc775694(v=ws.10).aspx

You can add classid's for your workstations and then setup the dhcp scope to issue IP based on the classid.
http://support.microsoft.com/kb/240247/EN-US/
E.g. of applying classid
http://www.techrepublic.com/article/use-dhcp-class-to-deny-internet-access-to-unauthorized-machines/5498436

I'd suggest you configure the classID on the Windows XP machines so that you don't need to go back again to make changes once your project is completed.
0
 
LVL 26

Expert Comment

by:Leon Fester
ID: 37812313
@dleaver sorry for duplicate post, this link was open whole day already :(
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question