Static only hosts, no dynamic/reserved leases

Simon Hobson dhcp1 at thehobsons.co.uk
Wed Feb 7 20:16:36 UTC 2018


george Nopicture <mad-proffessor at hotmail.com> wrote:

> #/etc/dhcp/dhcpd.conf
> 
> deny declines;
> deny bootp;
> authoritative;
> 
> subnet 192.168.0.0 netmask 255.255.255.248 {
> option domain-name-servers x.y.z.i;
> option routers 192.168.0.1;
> option broadcast-address 192.168.0.7;
> ping-check false;
> option subnet-mask 255.255.255.248;
> option arp-cache-timeout 42700;
> option ip-forwarding off;
> default-lease-time 93000;
> max-lease-time 93000;
> deny unknown-clients;
> boot-unknown-clients false;
> host fedora {
> hardware ethernet 00:fd:vc:c3:6m:qq;
> fixed-address 192.168.0.2; }
> }
> 
> thats my config even if i remove the option lines my pc named fedora
> gets an ip from the dhcp. I want only static configuration (meaning to
> not being able to see DHCPDISCOVER, DHCPREQUEST lines in journal) even
> if i set automatic ip configuration in my desktop's NetworkManager.

Firstly, please don't top post.
Second, really do NOT reply to the digest without resetting the subject correctly.

Now to the DHCP issue ...

It's really hard to see what's what with no formatting, but for the config you have, it is correct that host "fedora" gets an address - you've explicitly configured the server to give it one.

While it won't make any difference in your basic setup, host statements should NOT be put inside any other section (other than group). They are global in scope - but putting them inside another construct causes weird inheritance problems.

Fixing this and adding some formatting, you end up with this :

deny declines;
deny bootp;
authoritative;

subnet 192.168.0.0 netmask 255.255.255.248 {
  option domain-name-servers x.y.z.i;
  option routers 192.168.0.1;
  option broadcast-address 192.168.0.7;
  ping-check false;
  option subnet-mask 255.255.255.248;
  option arp-cache-timeout 42700;
  option ip-forwarding off;
  default-lease-time 93000;
  max-lease-time 93000;
  deny unknown-clients;
  boot-unknown-clients false;
}
host fedora {
  hardware ethernet 00:fd:vc:c3:6m:qq;
  fixed-address 192.168.0.2; }


What this says is that ONLY the host "fedora" with MAC address "00:fd:vc:c3:6m:qq" (I assume that's just some random string you've replaced the real address with) can get an address, and it will be 192.168.0.2. No other client will get a lease.

So I'm not clear exactly what you are trying to achieve here. If you don't want "anything at all" to get a lease then the simple option is not to even start the DHCP server - if it's not running, then it can't respond to clients.




More information about the dhcp-users mailing list