DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 30th April 2018
beavers beavers is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 54
Default dhclient(8) supersedes

I've got a number of supersede lines in dhclient.conf(5), but some of them are not showing up in the lease file.

/etc/dhclient.conf:
Code:
interface "em0" {
    supersede domain-name-servers 10.0.0.1;
    supersede host-name "myhostname";
    supersede domain-name "example.com";
}
/var/db/dhclient.leases.em0:
Code:
lease {
<snip>
  option domain-name-servers 1.2.3.4,5.6.7.8;
  option host-name "theirhostname";
  option domain-name "isp.com";
<snip>
}
I've looked around, but can't really find a description of the dhclient(8) behavior in this case. Does the client still put the server's values into the lease file, then just silently supersede them?
Reply With Quote
  #2   (View Single Post)  
Old 30th April 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,381
Default

From dhclient.conf(5), emphasis mine:
Code:
supersede option option-value;
          Use option-value for the given option regardless of the value in
          the lease. Each supersede for option overrides any previous 
          append, default, prepend or supersede for option.
From my interpretation of the highlighted phrase, I assume the lease file contains the lease offer, rather than what was superseded.

Does the client report that the supersedes are functioning?
Reply With Quote
  #3   (View Single Post)  
Old 30th April 2018
beavers beavers is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 54
Default

Quote:
Originally Posted by jggimi View Post
From my interpretation of the highlighted phrase, I assume the lease file contains the lease offer, rather than what was superseded.
I think you're right. Wow, the verbiage in the man page is very subtle.

Quote:
Originally Posted by jggimi View Post
Does the client report that the supersedes are functioning?
No, running it in the foreground just gives some basic responses:
Code:
em0: DHCPREQUEST to 255.255.255.255
em0: DHCPACK from 1.2.3.4 (00:01:23:45:67:89)
em0: bound to 1.2.3.200 from 1.2.3.4 (00:01:23:45:67:89)
em0 [priv]: add route 0.0.0.0/0.0.0.0 via 1.2.3.1: File exists
Permissions on /etc/dhclient.conf are 0644, everything seems fine there.
Reply With Quote
  #4   (View Single Post)  
Old 30th April 2018
beavers beavers is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 54
Default

hostname(1) and resolv.conf(5) are both correct, so I guess things truly are working as expected. I guess I was just thrown by the contents of the lease file.
Reply With Quote
  #5   (View Single Post)  
Old 30th April 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,381
Default

Glad your config file is working.

For infinite detail on how dhclient lease interactions work, see /usr/src/sbin/dhclient/dhclient.c. The source code is actually well documented.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenBSD New OpenBSD dhclient(8) J65nko News 1 7th May 2013 09:41 PM
dhclient configuration ? wlm2 OpenBSD General 5 25th August 2011 02:34 PM
dhclient -> urtw0: no link ....... sleeping rma OpenBSD Installation and Upgrading 10 20th August 2010 03:25 AM
CARP interface with DHClient xinform3n OpenBSD General 5 22nd July 2009 12:41 PM
dhclient at startup bsdnewbie999 OpenBSD General 3 31st March 2009 03:55 AM


All times are GMT. The time now is 11:59 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick