How to give out a static lease using DHCP server

If you need some help, this should be the first place to look.

Postby dingetje » Mon Oct 28, 2002 9:58 am

<font color='#000080'>Q: how do I configure the DHCP server to give out a static IP address based on the client's MAC address?

A:
  • make sure freesco is up and running (duh...)
    </li>
  • boot the client that you want to give a static lease
    </li>
  • login as root on freesco and type cat /etc/dhcpd.leases
    </li>
  • look for the client name in the generated list, in the example below I'm looking for a client called 'dingetje'
    lease 192.168.0.21 {
        starts 0 2002/10/27 16:45:26;
        ends 0 2002/11/03 16:45:26;
        hardware ethernet <span style='color:red'>00:00:c5:0d:7a:8</span>;
        uid 01:00:00:c5:0d:7a:8e;
        client-hostname <span style='color:blue'>"dingetje"</span>;
    }

    </li>
  • make a note of the hardware ethernet address (TIP: if you're using PuTTY or another terminal client, you can usually copy this text into the paste buffer).

    </li>
  • now edit /mnt/router/etc/dhcpd.conf and add the following lines:
    host <span style='color:blue'>dingetje</span> {
    fixed-address <span style='color:green'>192.168.0.50</span>;
    hardware ethernet <span style='color:red'>00:00:c5:0d:7a:8e</span>;
    }


    The fixed address must be outside the DHCP dynamic range (in this example the DHCP range is 192.168.0.20 to 192.168.0.30, so a free fixed address is 192.168.0.50).

    </li>
  • save the changes and type rc_dhcpd restart
    </li>
  • reboot the client, or use start->run->winipcfg->OK, click 'renew all' for win9x client or type 'ipconfig / renew' in a DOS box for WinNT/Win2K/WinXP clients.
    The client should get the static lease.</li>
</font>
dingetje
 

Return to FAQ - Frequently Asked Questions

Who is online

Users browsing this forum: No registered users and 2 guests

cron