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

Re: DHCP and IP routing



On Fri, Jan 21, 2005 at 02:57:37PM +0100, Urs Thuermann wrote:
> However, I have a second NIC in that client and I want the default
> route to point to a router on that network.  I have statically
> configured that second interface and the gateway in
> /etc/network/interfaces.
> 
> For the first NIC I want to use the DHCP server but I want to use the
> router and name server that is given in the DHCP reply but only for
> 10.0.0.0/8 (and a few other subnets) and not for the default route.
> So my question is how can I configure the dhcp-client to achieve this?
> I haven't found this in the man page.  I would also be willing to
> install another DHCP client that supports this, if there is one.

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:

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.  (I haven't tried changing DHCP-assigned
routers in this fashion, but I have superseded the domain name
provided by my ISP and I would expect the syntax and functionality to
be the same for routers as it is for domain-name.)

-- 
The freedoms that we enjoy presently are the most important victories of the
White Hats over the past several millennia, and it is vitally important that
we don't give them up now, only because we are frightened.
  - Eolake Stobblehouse (http://stobblehouse.com/text/battle.html)



Reply to: