<div dir="ltr">2014-04-07 21:15 GMT+02:00 Simon Hobson <span dir="ltr"><<a href="mailto:dhcp1@thehobsons.co.uk" target="_blank">dhcp1@thehobsons.co.uk</a>></span>:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">alessandro macuz <<a href="mailto:alessandro.macuz@gmail.com">alessandro.macuz@gmail.com</a>> wrote:<br>

<br>
> I could deduce the gateway from the DHCP server IP address because normally they coincide but that would be my assumption.<br>
<br>
</div>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.<br>
</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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 ?<br>
</blockquote><div><br></div><div>Sorry maybe I should have added more details but there is only one defaut gateway on the network of that interface and hence the dry-run returns always the same IP address. As to the second reply it will configure the interface.<br>
<br></div><div>Why I want to run a dry-run? Because eventually I need to install some routes pointing to the only gateway on the network. On the system there is another interface that gets the IP dinamically and two default routes are not OK <br>
</div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
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.<br>
</blockquote><br></div><div class="gmail_quote">I thought of this and delete the 2nd def route but even if for less than a second packets would load-balanced between the two default routes. Now that I'm writing I realize that the loadbalancing mechanism is in place only when the adm distance is the same, so maybe I can play with that value if the DHCP protocol allows that.<br>
<br></div><div class="gmail_quote">Alex<br></div></div></div>