[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DHCP and IP routing



Dave Sherohman <esper@sherohman.org> writes:

> I missed the thread up to this point, but the DHCP client installed
> by the dhcp-client package is named dhclient, not dhcp-client.  Its
> configuration lives in dhclient.conf, so, checking man dhclient.conf:

Yes, I have read that man page and I had already tried the supersede
routers option.

> OPTION MODIFIERS
> ...
>        The supersede statement
> 
>         supersede { [ option declaration ] [, ... option declara­
>        tion ]}
> 
>        If  for  some  set of options the client should always use
>        its own value  rather  than  any  value  supplied  by  the
>        server,  these  values  can  be  defined  in the supersede
>        statement.
> 
> There isn't any actual documentation of the "routers" option in this
> man page, but it does appear in the sample configs both in man and in
> the default dhclient.conf, so the way to do what you want should be
> to put the line:
> 
> supersede routers a.b.c.d;
> 
> into /etc/dhclient.conf.

This causes another router to be used for the default route.  However,
I don't want any default route on that interface.  I would like to add
a subnet route using the router from the DHCP reply.  But I have not
found any option to set a subnet route nor any way (say a variable) to
refer to some specific value from the DHCP reply.  I couldn't even
configure dhclient to not set any default route.  By giving an
unreachable router like

    supersede routers 0.0.0.0;

I could achieve it in a somewhat unclean way with an error message.  I
then added in /etc/network/interfaces an entry like

   iface eth0 inet dhcp
       up ip route add 10.0.0.0/8 via 10.1.2.254

what does what I need, but I'd prefer not to have to specify the
router statically in that file but use the router from the DHCP
reply.  I the router address changes some day, the statically
configured router will cause problems and I need to adapt instead of
having this be done automatically.


urs



Reply to: