dhclient dry-run - need to know the def gateway without installing the def route

Andrew Hood ajhood at fl.net.au
Tue Apr 8 15:06:15 UTC 2014


On 09/04/2014 12:47 AM, alessandro macuz wrote:
> 2014-04-08 16:39 GMT+02:00 Sten Carlsen <stenc at s-carlsen.dk
> <mailto:stenc at s-carlsen.dk>>:
>
>     Just a thought:
>
>     Did you consider to let the DHCP server send the correct gateway?
>     Would that solve the issue?
>
>
> This is a dual-homed machine. The default route must be through via gw
> 1 through the interface 1 but some routes must be reached via the
> gateway 2 thorugh the interface 2. Configuration on the host via DHCP
> on any interfaces is preferable
>
> I realize now that is a much more precise description of the situation
> and the goals that I must achieve and I should have written at the
> beginning :-)
You can only provide multiple defaults routes if they are all
equivalent. I have seen this screwed up multiple times.
If some devices can only be reached via gateway 2 then they need static
routes. You might have to append option 33 to the
dhcp-parameter-request-list and add code to the client to process it.
>From the man page:

       option static-routes ip-address ip-address
                         [, ip-address ip-address...];

         This  option  specifies a list of static routes that the client
should install in its routing cache.  If multiple routes to the
         same destination are specified, they are listed in descending
order of priority.

         The routes consist of a list of IP address pairs.  The first
address is the destination address, and the second address is  the
         router for the destination.

         The  default  route  (0.0.0.0)  is  an  illegal  destination
for a static route.  To specify the default route, use the routers
         option.  Also, please note that this option is not intended for
classless IP routing - it  does  not  include  a  subnet  mask.
         Since  classless  IP  routing  is  now  the most widely
deployed routing standard, this option is virtually useless, and is not
         implemented by any of the popular DHCP clients, for example the
Microsoft DHCP client.

-- 
There's no point in being grown up if you can't be childish sometimes.
-- Dr. Who

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20140409/d96b4ab7/attachment.html>


More information about the dhcp-users mailing list