Re: running dhclient on a statically configured interface?
- In reply to: Jon Clausen : "Re: running dhclient on a statically configured interface?"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 07 Jan 2025 20:27:54 UTC
Hi Jon, On Tue Jan 7, 2025 at 7:59 PM CET, Jon Clausen wrote: > Hi Souji > > On 2025-01-06 22:14:17 (+0100), Souji Thenria wrote: > > Hi Jon, > > > > On Mon Jan 6, 2025 at 6:57 PM CET, Jon Clausen wrote: > > > Is it feasible to run dhclient(8) on the uplink interface, but still > > > have > > > the interface itself be statically configured? > > > > You might be able to configure this in the dhclient.conf(5) file; > > Something like this: > > > > interface "ep0" { > > request domain-name-servers; > > } > > Interesting. I'll definitely have to read the man page closer, though I > suspect there's not a direct way to do what I'm fishing for. > > > This should only request the DNS server and not anything else. However, > > I never tested this configuration... > > I think you're right. > > > > And secondly, is there some method to propagate the options that dhclient > > > receives from the server for other non-standard purposes? > > > > > > > I'm not sure what you mean by that. > > Some sort of "script hook" or something, dhclient could be configured to > hand over the information from the dhcp server over to, so that I could > create my own tooling to handle whatever the server provides. > > For the resolver info, for example: > I would need to get that from the jail running the uplink, to the jail that > handles dns. > > > But DHCP supports custom options, > > and I'm sure you can configure it somehow in the dhclient.conf(5) file > > as well. > > Having thought a little more about it, I think a better way of describing > what I'd like might be: > > Sort of a "dry-run" option, that'll let the client listen on the network and > report the offer from the server somewhere else - maybe just log it - but > not actually let it reconfigure the network interface. > > Essentially, I'd just like to get notified if the servers offer changes, and > make my decisions manually. > > Thanks for the explanation. I now get what you are trying to do. Based on what I have seen on the man pages, dhclient won't be the right tool. Some ideas, what you could do, there are probably better ones...: 1. Use other public DNS servers e.g. Cloudflare/Google/etc... 2. Write a shell script that uses other CLI tools. There are some tools that are mainly used for debugging purposes, but they might do what you are looking for (like dhcping and dhcpdump.) 3. Modify the source code of the dhclient tool to fit your needs. 4. It's time to run your own DNS resolver. > Of course the real issue here is that I'm not happy about letting my > ISP > make changes to my devices unilaterally. > > I've seen enough fatfingering over the years to not really trust anyone... > > > br > /jon I feel like, in that case, your best options are 1 and 4 of the above list. Regards, Souji -- Souji Thenria Website: www.souji-thenria.net