dhclient dry-run - need to know the def gateway without installing the def route
dhcp1 at thehobsons.co.uk
Mon Apr 7 19:15:43 UTC 2014
alessandro macuz <alessandro.macuz at gmail.com> wrote:
> I could deduce the gateway from the DHCP server IP address because normally they coincide but that would be my assumption.
You've heard the expression that "assume" makes an "ass" out of "u" and "me", well your assumption is badly wrong. In home and small networks it is likely to be true (not mine though). But once you get to business networks then its more likely that the DHCP server is not at the same IP address as the router.
However, I'm still not quite sure why you are doing things the long way round. What's specifically wrong with using the route that comes with the lease ? Or more to the point, what's wrong with dealing with it when you get it ? And BTW - have you considered the possibility of getting different answers to your two queries ?
For many clients (certainly the ISC one on Linux) you can supply your own script/modify the stock one. That means you can go and accept a lease, then use your own script to fiddle with the system. Or at least I thin that's the case.
More information about the dhcp-users