On Fri, Jul 27, 2012 at 00:42, Brynet wrote:
> On Thu, Jul 26, 2012 at 10:09:28PM -0400, Ted Unangst wrote:
>> I have a system with two network interfaces (em0 and em1), running dhcp
>> on both. Both dhcp servers provide me with a nameserver, but only one
>> of them works (I can't fix this).  There is a config file for dhclient
>> I can use, but it only supports the supersede keyword.  I don't want
>> to statically configure a nameserver override for em1, because the
>> whole point is that the good nameserver on em0 can change.  I just
>> want to say "pretend this option did not arrive."
>>
>> Diff below adds a little support for an ignore keyword.  Like
>> supersede, except don't actually use the supplied value.
> 
> Not commenting on the diff or the feature, which could indeed be the
> corect solution, if maybe only to work around some strict/broken servers.
> 
> I was under the impression that if you added an "request" statement
> excluding the 'domain-name-servers' option the server would honour that and
> only offer the options you've explictly requested..
> 
> Does something like this work for you?
> 
> interface "em0" {
> request subnet-mask, broadcast-address, routers, domain-name-servers;
> }
> 
> interface "em1" {
> request subnet-mask, broadcast-address, routers;
> }

Oh, nice, I hadn't thought of that.  On the downside, if I add another
interface that works normally, I've made a mess of dhclient.conf.  I'd
much prefer to blacklist interfaces instead of relying on an endless
series of whitelists.

That said, the part about the server should honor this is sadly not
true.  In a quick test, the server still sent back domain-name-servers
even though it wasn't requested, and the way the dhclient code is
written, it will accept unrequested options.  I'm not convinced this
is a bug in either server or client, I can justify both behaviors,
even if they frustrate me atm.

Reply via email to