Solved

Eliminate a default route received by a Dhcp server

Posted on 2004-04-21
4
221 Views
Last Modified: 2010-04-13
Hi,

I have a Pc running Win2k advance server sp4 with 2 Ip interfaces connected to 2 different networks (Net1 and Net2) and the Pc acts as Dhcp client.
There are Dhcp servers in both networks, each of them releasing the Ip address, netmask and default router.
After connecting both cables both Dhcp server "inject" a default route, so in the Pc the routing table is as follows:

Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      10.210.13.1   10.210.13.150       1           (Net1 side)
          0.0.0.0          0.0.0.0      192.168.1.1   192.168.1.56       1           (Net2 side)

My need is to delete the second default route after the Dhcp server release it and without touching the Dhcp server configuration (becasue in use by other users and administered by another department). I will add some specific routes with "route -p" to reach the desired portions of the network on Net2 side instead, so that the final desired routing table will appear as follows:

Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      10.210.13.1   10.210.13.150       1           (Net1 side)
          10.1.1.0          255.255.255.0      192.168.1.1   192.168.1.56       1           (Net2 side)
          10.1.2.0          255.255.255.0      192.168.1.1   192.168.1.56       1           (Net2 side)

Note that this configuration has to survive a reboot, of course.

To summarize: The Dhcp server on Net2 side injects a default route that I don't want, my need is either do not receive it or eliminate it, working on the Dhcp client only.
Any idea?

Thank you in advance!
Best regards.
Diego.
0
Comment
Question by:Diego Balgera
  • 2
  • 2
4 Comments
 
LVL 25

Accepted Solution

by:
mikeleebrla earned 250 total points
Comment Utility
just do a route delete 1.2.3.4 ,,,, you can add this to a login script so it will survive a reeboot or new lease
0
 

Author Comment

by:Diego Balgera
Comment Utility
Hi Mikeleebrla,
thank you for your answer.

The problem now is: if I add the "route delete" command to a login script, this will be executed when the corresponding user logs in. This means that, until no user logs in, the undesired default route won't disappear.
How could be possible to execute such command when the machine boots, of course after the interface is configured, but with no user login?

Thank you.
Diego.
0
 
LVL 25

Expert Comment

by:mikeleebrla
Comment Utility
then make it a startup script
0
 

Author Comment

by:Diego Balgera
Comment Utility
Hi Mike,

this solution works and it is quite close to what I need to reach.
The only surviving problem is: the route is deleted every time the Pc is rebooted, but in case the lease is renewed for whatever reason (i.e., cable detached and reattached), the Pc still has 2 default routes in the routing table.
Any idea to solve this last part of the problem? Any possibility to execute a batch file to delete the route every time the Dhcp lease occurs?

Thank you again!
Diego.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

13 Experts available now in Live!

Get 1:1 Help Now