Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

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?

Thanks,
AD
0
illtbagu
Asked:
illtbagu
2 Solutions
 
vtobusmanCommented:
the route command will work
and you can create a batch file in the startup...


use this

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

 route add 0.0.0.0 0.0.0.0 <Gateway>
simple....

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

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


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.

C:\WINDOWS\Desktop>ROUTE PRINT

Active Routes:

  Network Address          Netmask  Gateway Address        Interface  Metric
        127.0.0.0        255.0.0.0        127.0.0.1        127.0.0.1       1
     192.168.36.0    255.255.255.0    192.168.36.60    192.168.36.60       1
    192.168.36.60  255.255.255.255        127.0.0.1        127.0.0.1       1
   192.168.36.255  255.255.255.255    192.168.36.60    192.168.36.60       1
        224.0.0.0        224.0.0.0    192.168.36.60    192.168.36.60       1
  255.255.255.255  255.255.255.255    192.168.36.60    192.168.36.60       1


THANKS FOR YOUR HELP :)
AD
0
 
boxcar7Commented:
Try this after booting up:

ROUTE CHANGE 0.0.0.0 MASK 0.0.0.0 192.168.36.4
 (I'm assuming you want 192.168.36.4 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).
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!

 
andyabraCommented:
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.
0
 
chicagoanCommented:
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?
0
 
illtbaguAuthor Commented:
boxcar7,

I tried your suggestion and Im getting a error:

---------------------------------------------------------------------------------------
Microsoft(R) Windows 98
   (C)Copyright Microsoft Corp 1981-1999.
C:\WINDOWS\Desktop>ROUTE CHANGE 0.0.0.0 MASK 0.0.0.0 192.168.36.4
Could not find route to CHANGE.
---------------------------------------------------------------------------------------

Thanks,
AD
0
 
boxcar7Commented:
Must be no default route (as opposed to a bogus one).

Do this instead then:

ROUTE ADD 0.0.0.0 MASK 0.0.0.0 192.168.36.4

0
 
illtbaguAuthor Commented:
boxcar7,
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 0.0.0.0 MASK 0.0.0.0 192.168.36.4 according to a list of given user names. That way I can run this command during logon according to a list of approved users.

Thanks,
AD
0
 
boxcar7Commented:
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?)
0
 
boxcar7Commented:
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.

0
 
illtbaguAuthor Commented:
boxcar7

oooh good idea i like #2. boxcar7 and vtobusman thanks for all of your help :)
0

Featured Post

Independent Software Vendors: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now