Find the answer to your Linux question:
Results 1 to 7 of 7
I have more than 100 clients connected with server where DHCP server is running.I want the DHCP server to provide the same IP to a particular client every time it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Location
    india
    Posts
    57

    How to configure DHCP to provide statis IP


    I have more than 100 clients connected with server where DHCP server is running.I want the DHCP server to provide the same IP to a particular client every time it boots up.But its very difficult to copy-paste all the MAC address and put it in dhcpd.conf like below example.

    Example:

    host*w53-4
    {
    hardware ethernet 00:E0:CC:21:C1:22;
    ******* fixed-address 10.28.200.8;
    ******* option host-name "w53-4.domain.com";
    ******}

    please help if there is any other method

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    I only use the following here at home without issues

    Code:
            host <system> {
                    hardware ethernet 00:21:70:A3:FA:58;
                    fixed-address 192.168.1.250;
            }

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Mar 2009
    Location
    india
    Posts
    57
    I know the code.But if there are 2000 computers connected with the DHCP server then i have to write this code 2000 times in dhcp.conf. i wanted to know an alternative process so that i dont need to copy paste 2000 MAC address.

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,221
    What we do for several hundred server machines:
    We (manually) maintain the mac addresses in DNS and HINFO record.
    Like this:
    <inventory_hostname> IN HINFO "mac" "<mac address>"

    With <inventory_hostname> consisting of the datacenter name and a incrementing number.
    The machines have CNAMES, describing their purpose (db-1.int.<domain>.<tld>, <appname>.int.<domain>.<tld>, etc)


    We maintain mac addresses (up to and sometimes exceeding three per machine) in dns is to have one central source of information.
    You have to define hostnames anyhow. Our decision was to do that on dns/dhcp, and not on each host and some ddns magic.
    Reason: You do it once, and can then pxe install the machine as needed.

    So, the mac addresses and hostnames are in dns.
    And we have a svn post-commit hook to generate a dhcpd config from that.
    You must always face the curtain with a bow.

  5. #5
    Just Joined!
    Join Date
    Mar 2009
    Location
    india
    Posts
    57
    Actually i am using only DHCP server .I do nt use DNS server because i do not need it.Now i want to configure kickstart that is the reason i want the DHCP server to provide static IP to all the clients.

  6. #6
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,221
    As there needs to be an assignment from mac to ip and hostname, I donīt think you can skip manual work.

    If you donīt care so much which IP/hostname a machine gets as long as it gets always the same IP/hostname,
    then you could
    - setup a regular dynamic dhcp pool
    - boot your machines once with any OS that sends a dhcp request. Maybe a livecd (good remote management systems offer virtual media) or via pxe.
    - this way you collect valid mac addresses
    - then parse the lease files for these mac addresses and generate static IP/hostname config snippet useable for dhcpd.conf
    - then delete the lease files
    - and boot them again, this time to kickstart


    Other than that, I consider DNS to be part an essential part of infrastructure.
    And in your example, you do define hostnames.
    What good are they without dns? Or are there no connections *to* these machines?
    You must always face the curtain with a bow.

  7. #7
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    Quote Originally Posted by aaaaaarko View Post
    I know the code.But if there are 2000 computers connected with the DHCP server then i have to write this code 2000 times in dhcp.conf. i wanted to know an alternative process so that i dont need to copy paste 2000 MAC address.
    Sorry, it was a late night reply. I did not know that a particular client meant every one. To me a a particular client statement says you are only looking at one to maybe a hand full not every one.

    Here is a thought, why not assign static IP Addresses to the clients? Would be a lot easier and less work.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

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