Solved

overriding dhcp assigned gateway in windows 98

Posted on 2003-11-04
11
381 Views
Last Modified: 2010-03-19
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
Comment
Question by:illtbagu
11 Comments
 
LVL 5

Assisted Solution

by:vtobusman
vtobusman earned 100 total points
ID: 9682498
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
 
LVL 1

Author Comment

by:illtbagu
ID: 9683282
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
 
LVL 4

Expert Comment

by:boxcar7
ID: 9683427
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
 

Expert Comment

by:andyabra
ID: 9684060
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
 
LVL 18

Expert Comment

by:chicagoan
ID: 9684925
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:illtbagu
ID: 9695639
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
 
LVL 4

Expert Comment

by:boxcar7
ID: 9696078
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
 
LVL 1

Author Comment

by:illtbagu
ID: 9696213
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
 
LVL 4

Expert Comment

by:boxcar7
ID: 9696307
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
 
LVL 4

Accepted Solution

by:
boxcar7 earned 300 total points
ID: 9696496
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
 
LVL 1

Author Comment

by:illtbagu
ID: 9696725
boxcar7

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Let’s list some of the technologies that enable smooth teleworking. 
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now