Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I setup DHCP on CentOS 5.5. My issue is whenever my client leases, the server gave the last available IP. eg. my dhcp ip range is 192.168.1.10 to 192.168.1.100, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    44

    DHCP Leasing Issue


    Hi,

    I setup DHCP on CentOS 5.5. My issue is whenever my client leases, the server gave the last available IP.

    eg. my dhcp ip range is 192.168.1.10 to 192.168.1.100, the server gave me 192.168.1.100, then 192.168.1.99 for the second machine.

    How to configure the dhcp to give the front numbers, eg 192.168.1.10 first, then 192.168.1.11 and so on......

    Then on option domain-name-servers 8.8.8.8;
    how can I include second nameserver ? 8.8.4.4

    See below for my dhcpd.conf


    Code:
    dns-update-style interim;
    ignore client-updates;
    
    subnet 192.168.1.0 netmask 255.255.255.0 {
    
    # --- default gateway
            option routers                  192.168.1.1;
            option subnet-mask              255.255.255.0;
    
            option nis-domain               "fwdhcp";
            option domain-name              "fwdhcp";
            option domain-name-servers       8.8.8.8;
    
            option time-offset              -18000; # Eastern Standard Time
    #       option ntp-servers              192.168.1.1;
    #       option netbios-name-servers     192.168.1.1;
    # --- Selects point-to-point node (default is hybrid). Don't change this unless
    # -- you understand Netbios very well
    #       option netbios-node-type 2;
    
            range dynamic-bootp 192.168.1.10 192.168.1.100;
            default-lease-time 21600;
            max-lease-time 43200;
    
            # we want the nameserver to appear at a fixed address
            host ns {
                    next-server marvin.redhat.com;
                    hardware ethernet 12:34:56:78:AB:CD;
                    fixed-address 207.175.42.254;
    }
    }
    Hope you can help me.

    Thanks!

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,760
    1)
    how can I include second nameserver ? 8.8.4.4
    Google:

    Code:
    range 192.168.1.128 192.168.1.254;                   # Range of IP addresses to be issued to DHCP clients
               option subnet-mask              255.255.255.0;    # Default subnet mask to be used by DHCP clients
               option broadcast-address        192.168.1.255;    # Default broadcastaddress to be used by DHCP clients
               option routers                  192.168.1.1;      # Default gateway to be used by DHCP clients
               option domain-name              "your-domain.org";
               option domain-name-servers      40.175.42.254, 40.175.42.253;           # Default DNS to be used by DHCP clients
               option netbios-name-servers     192.168.1.100;    # Specify a WINS server for MS/Windows clients.

    2)
    How to configure the dhcp to give the front numbers, eg 192.168.1.10 first, then 192.168.1.11 and so on......
    Read the man page - it may say:

    The DHCP server generates the list of available IP addresses from a
    hash table. This means that the addresses are not sorted in any par-
    ticular order, and so it is not possible to predict the order in which
    the DHCP server will allocate IP addresses. Users of previous ver-
    sions of the ISC DHCP server may have become accustomed to the DHCP
    server allocating IP addresses in ascending order, but this is no
    longer possible, and there is no way to configure this behavior with
    version 3 of the ISC DHCP server.

  3. #3
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Quote Originally Posted by wizzkid View Post
    How to configure the dhcp to give the front numbers, eg 192.168.1.10 first, then 192.168.1.11 and so on......
    From the man pages
    The DHCP server generates the list of available IP addresses from a hash table. This means that the addresses are not sorted in any particular order, and so it is not possible to predict the order in which the DHCP server will allocate IP addresses. Users of previous versions of the ISC DHCP server may have become accustomed to the DHCP server allocating IP addresses in ascending order, but this is no longer possible, and there is no way to configure this behavior with version 3 of the ISC DHCP server.
    As you can see it isn't possible.

    Then on option domain-name-servers 8.8.8.8;
    how can I include second nameserver ? 8.8.4.4
    Just add the second host to the line separated by a comma.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jan 2011
    Posts
    44
    Thank you so much! Understand..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •