1

Suppose there's just one Ubuntu / ISC-DHCP (v3) server on the network. I've successfully been able to provide "DHCP reservations" meaning MAC foo gets ip 1.2.3.4, whereas everyone else just gets an address from a pool, etc.

But is it possible to only make the address specific to a particular reservation but also other options like the router and DNS servers?

Example: I want computers 1, 2, and 3 to get addresses from the 192.168.100.10 to 192.168.100.20 range, use 192.168.100.1 as the router, and use 192.168.100.2 and 192.168.100.3 as the DNS servers.

But I want computer 4 to get a particular address (let's say 192.168.100.21), use 192.168.100.4 as the router, and use 192.168.100.5 as the DNS server.

This is my attempt, but I don't think it's right:

subnet 10.100.0.0 netmask 255.255.0.0 {
  option domain-name-servers 1.2.3.4;
  option domain-name "foo";
  option routers 5.6.7.8;
  option broadcast-address 10.100.255.255;
  default-lease-time 600;
  max-lease-time 7200;

  host windows-matt-2 {
    hardware ethernet 00:1f:d0:a1:55:5d;
    fixed-address 10.100.101.21;
  } 
}

subnet 10.100.0.0 netmask 255.255.0.0 {
  range 10.100.201.1 10.100.201.254;
  option domain-name-servers 10.100.1.1;
  option domain-name "lundfam.local";
  option routers 10.100.1.1;
  option broadcast-address 10.100.255.255;
  default-lease-time 600;
  max-lease-time 7200;
}

1 Answer 1

4

It should be as simple as doing something like this.

host windows-matt-2 {
  option domain-name-servers 1.2.3.4;
  option domain-name "foo";
  option routers 5.6.7.8;
  option broadcast-address 10.100.255.255;
  default-lease-time 600;
  max-lease-time 7200;
  hardware ethernet 00:1f:d0:a1:55:5d;
  fixed-address 10.100.101.21;
}

subnet 10.100.0.0 netmask 255.255.0.0 {
  range 10.100.201.1 10.100.201.254;
  option domain-name-servers 10.100.1.1;
  option domain-name "lundfam.local";
  option routers 10.100.1.1;
  option broadcast-address 10.100.255.255;
  default-lease-time 600;
  max-lease-time 7200;
}
4
  • I'll try that out! Dec 5, 2011 at 1:15
  • BTW, you shouldn't have to specify a broadcast address, lease times or anything else that is different from the default settings for the scope.
    – Zoredache
    Dec 5, 2011 at 1:25
  • This worked. Regarding your last comment, could I make the name servers, domain name, routers, and the broadcast address defaults as well (and only override them as needed)? Or would it just be limited to default-lease-time and max-lease-time in my case? Dec 5, 2011 at 2:03
  • I usually set the domain name and lease times globally (outside of a scope). The broadcast address should not be required at all for any modern OS/network. The only things you should need to set as part of the per-host reservations are things that will be different from the scope/global settings.
    – Zoredache
    Dec 5, 2011 at 2:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .