overriding dhcp assigned gateway in windows 98

I have a mixed network of windows 2000 and 98 machines. They are setup for dhcp. I dont have DHCP setup to assign the gateway. I would like to limit access to the gateway per machine by just manually intering in the gateway IP address. This works just fine with windows 2000, I can override the gatway IP address that DHCP is assigning, which in reality is none.

The problem is with the windows 98 machines, I cant override the gateway if DHCP is enabled. What can I do to get this to work?

Can the ROUTE command help me with anything,
Or maybe the hosts file?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

the route command will work
and you can create a batch file in the startup...

use this

 route -f <Gateway>
this will remove your default gateway and if you need to add it back in the command is

 route add <Gateway>

now just create a batch file and place it in the startup group
  good luck
illtbaguAuthor Commented:
ok i have tried to get this to work with no luck. our gateway is our subnet is

could you show me exactly what it should be. from what you have said all i need to do is

right now if i type in ROUTE PRINT on a windows 98 machine i get

Microsoft(R) Windows 98
   (C)Copyright Microsoft Corp 1981-1999.


Active Routes:

  Network Address          Netmask  Gateway Address        Interface  Metric       1       1       1       1       1       1

Try this after booting up:

 (I'm assuming you want to be your new gateway).

You can put it in a batch file and either put it in your StartUp Group or, if you are really slick, put it in the RunServices section of your registry (then it will run before you log on).
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

How many clients do you have?  What if you manually assigned IP addresses instead of using DHCP (you could leave it enabled on the router... no harm, no foul)?  Then you could optionally either enter a default gateway or not, per machine.
Are you trying to limit internet access for these machines? Why not assign the gateway via DHCP and null route the machines you don't want to grant access to?
illtbaguAuthor Commented:

I tried your suggestion and Im getting a error:

Microsoft(R) Windows 98
   (C)Copyright Microsoft Corp 1981-1999.
Could not find route to CHANGE.

Must be no default route (as opposed to a bogus one).

Do this instead then:


illtbaguAuthor Commented:
Thanks works great :).

Before I close this question out I was hoping someone might answer a simple question for me about using this in the netlogon batch file. I need this to check if its a windows 98 machine and if it is to check what the user name is and run the ROUTE ADD MASK according to a list of given user names. That way I can run this command during logon according to a list of approved users.

There are actually a number of ways of tackling this.  It would be difficult in a batch script since you have Win 98 clients, because it has no real concept of %USERNAME% (like NT and above does).  Kix scripts might work.

However, you might consider one of these solutions.

1) If individuals have network home directories, consider placing "personal.bat" files in their home directories and calling it from the batch file.  
e.g. :

call H:\personal.bat

In addition to be able to do the routing, you can set up specific individual mappings or other commands for the users on an individual basis as need be.

2) Create another batch file that is accessible (via permissions) only to the users you want to route.  Call that batch file from the script.  Users who don't have access to the script will get an error--access denied on logon, but it won't pop up.  (What user actually watches their logon script anyhow?)
Sorry, just reread my post -- a bit unclear (late night last night :) )...

In both of the recommendations, you call the new batch files from the logon script.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
illtbaguAuthor Commented:

oooh good idea i like #2. boxcar7 and vtobusman thanks for all of your help :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.