LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   DHCP with multi default-lease-time in the same subnet (http://www.linuxquestions.org/questions/linux-server-73/dhcp-with-multi-default-lease-time-in-the-same-subnet-4175415780/)

gnu699 07-09-2012 06:18 PM

DHCP with multi default-lease-time in the same subnet
 
I configure a DHCP server.

In this configuration i would like, in the same subnet, 2 differents
default-lease-time & max-lease-time

My goal:

"fixed-address" with default-lease-time & max-lease-time
and "range" with another default-lease-time & max-lease-time

Is it possible?


Thank you very much.


gnu

chrism01 07-09-2012 11:03 PM

There's a few example cfgs here http://www.linuxtopia.org/online_boo...ml#config-file
If it was me I'd try

1. add times into the blocks containing fixed addr hosts & test 'service dhcpd configtest' ? or start it and test
2. if that doesn't work, try declaring 2 subnets with non-overlapping ranges; one for dhcp, one for fixed addrs and try that in the cfg.

gnu699 07-10-2012 12:28 PM

Ok i'm going to try it.

And make like that:

Code:

group {
  option routers                  192.168.1.254;
  option subnet-mask              255.255.255.0;
  option domain-name              "example.com";
  option domain-name-servers      192.168.1.1;
  default-lease-time 86400;
  max-lease-time 1296000;

  host apex {
      option host-name "apex.example.com";
      hardware ethernet 00:A0:78:8E:9E:AA;
      fixed-address 192.168.1.4;
  }

  host raleigh {
      option host-name "raleigh.example.com";
      hardware ethernet 00:A1:DD:74:C3:F2;
      fixed-address 192.168.1.6;
  }
}

group {
  option routers                  192.168.1.254;
  option subnet-mask              255.255.255.0;
  option domain-name              "example.com";
  option domain-name-servers      192.168.1.1;
  default-lease-time 600;
  max-lease-time 7200;

  range 192.168.1.230 192.168.1.253;
}

What do you think?

chrism01 07-12-2012 02:08 AM

You'll just have to test it and let us know what happened ... its not like you're going to break (ie delete) anything with a DHCP test.

gnu699 07-19-2012 01:10 PM

For who pass on that post.

That it works:

Code:

ddns-update-style none;
log-facility local7;

        option routers                  192.168.200.1;
        option subnet-mask              255.255.255.0;
        option broadcast-address        192.168.200.255;
        option domain-name-servers      192.168.200.1;
        option domain-name              "exemple.com";
        default-lease-time              172800;
        max-lease-time                  1296000;

        ## Free Pool from 240 to 245 ##
subnet 192.168.200.0 netmask 255.255.255.0 {
        range 192.168.200.240 192.168.200.245;
        option broadcast-address 192.168.200.255;
        option domain-name-servers 192.168.200.1;
        option domain-name "exemple.com";
        option routers 192.168.200.1;
        option broadcast-address 192.168.200.255;
        default-lease-time 43200;
        max-lease-time 86400;
        }

        ## Fixed address ##

        host dhcp-server {
        hardware ethernet 52:54:00:17:f2:ca;
        fixed-address 192.168.200.5;
        }

        host client1 {
        hardware ethernet 52:54:00:43:fe:cd;
        fixed-address 192.168.200.100;
        }

Thanks chrism01


All times are GMT -5. The time now is 03:02 PM.