100 likes | 128 Views
DHCP server & Client. Objectives to learn how to setup dhcp servers Contents Download and Install The DHCP Package The /etc/dhcpd.conf File Upgrading Your DHCP Server How to get DHCP started Modify Your Routes for DHCP on Linux Server Configuring Linux clients to use DHCP
E N D
DHCP server & Client • Objectives • to learn how to setup dhcp servers • Contents • Download and Install The DHCP Package • The /etc/dhcpd.conf File • Upgrading Your DHCP Server • How to get DHCP started • Modify Your Routes for DHCP on Linux Server • Configuring Linux clients to use DHCP • Simple DHCP TroubleshootingPracticals • working with TCP/IP utilities and files
Download and Install The DHCP Package • You have three ways to install DHCP server on SuSE • With Yast (install sample config and prepare lease data base) • RPM (Simply install it, togeather with sample config) • You need at least RPM-package dhcp-server if you download manually • TAR-BALL (Allways latest version, the ISC standard dhcp, manual work) • Getting the DHCP server with YAST • Will download and start configure DHCP • Installing from RPM’s • Download from Sunet or ftp.suse.com • You can also obtain dhcp sources directly from ISC The version rpm number is dhcp-3.0.2-6in our example, and 3.0.3 for the tar ball. # yast dhcp-server # rpm –ivh dhcp-3.0.2-6.i586.rpm # rpm –ivh dhcp-server-3.0.2-6.i586.rpm # cd /usr/local/src #wget ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.3.tar.gz
The /etc/dhcpd.conf File basics • Copy sample dhcpd.conf file to /etc/. : RPM: TAR: It is practical to begin with the sample config file • Basic file format, here the subnet declaration cp /usr/share/doc/packages/dhcp-server/dhcpd.conf /etc/. cp /usr/local/src/dhcp-3.0.3/server/dhcpd.conf /etc/. subnet 192.168.1.0 netmask 255.255.255.0 { default-lease-time 86400; max-lease-time 86400; option routers 192.168.1.100; option log-servers 192.168.1.100; option broadcast-address 192.168.1.255; option domain-name-servers 192.168.1.100, 80.84.37.3; option nntp-server 192.168.1.100; range 192.168.1.201 192.168.1.220; }
The /etc/dhcpd.conf File fix/denial • Deliver fixed address to a host • Dont do DHCP on all interfaces/subnets if multihomed • TFTP boot server and boot loader file host printer { hardware ethernet 00:50:DA:38:CE:23; fixed-address 192.168.1.64; option domain-name-servers 192.168.1.100; option broadcast-address 192.168.1.255; option domain-name "printer.ikea.se"; } subnet 80.84.37.0 netmask 255.255.255.240 { not authoritative; } next-server 192.168.1.60; # tftp-server filename "pxelinux.0"; # bootloader host brutebert { hardware ethernet00:B0:D0:39:63:8C; }
Dynamic DNS & DHCP • This is not the full story, DNS is also needed • You will need a DNS in order to update zonefiles • Main entries in /etc/dhcpd.conf • You also need one authorized key to allow updates • These entries comes before any subnet declaration authoritative; ddns-update-style interim; ddns-domainname "radio.ing-steen.se"; update-static-leases on; key "DHCP-UPDATER" { algorithm HMAC-MD5; secret ”<keydata>"; }
Dynamic DNS & DHCP • The Forward and Reverse name Zone-files to update • They came after the ddns entries in same file. • Zones must be specified to the DHCP • Last comes the standard subnet declaration, like on page 3 with this added to it zone radio.ing-steen.se. { primary 172.16.0.5; key DHCP-UPDATER; } zone 16.172.in-addr.arpa. { primary 172.16.0.5; key DHCP-UPDATER; } authoritative; get-lease-hostnames true; do-forward-updates true; allow unknown-clients; ddns-updates on;
How to get DHCP started • DHCPD is depending on /var/lib/dhcp/dhcpd.leases You might need to erase existing lease files and create an empty: dhcpd.leases contain leases database format when in action: • Starting the dhcpd server at boot • Stopping and Reloading the server • Manual start of dhcpd (tar-ball) # rm –f /var/lib/dhcp/dhcpd.leases # touch /var/lib/dhcp/dhcpd.leases lease 172.16.0.67 { starts 0 2004/09/05 04:41:09; ends 1 2004/09/06 04:41:09; hardware ethernet 00:0d:93:83:8a:8e; uid 01:00:0d:93:83:8a:8e; } # chkconfig dhcpd on # rcdhcpd start # rcdhcpd stop # rcdhcpd restart # /usr/sbin/dhcpd –cf /etc/dhcpd.conf
Modify Your Routes for DHCP on Linux Server • Client temporary solution to broadcast for IP Add the route to 255.255.255.255 from the command line If the message 255.255.255.255: Unknown host appears then try adding the following entry to your /etc/hosts file: Then, try: • Permanent solution add in /etc/init.d/boot.local # route add -host 255.255.255.255 dev eth0 255.255.255.255 dhcp # route add -host dhcp dev eth0 # route add -host 255.255.255.255 dev eth0
Summary • DHCP server is used to deliver IP parameters • Configuration sit in /etc/dhcpd.conf • Leases sit in /var/lib/dhcp/dhcpd.leases • DHCP can deliver boot strap files to diskless • With options you can deliver many functions • DHCP server usally run as stand alone server • Start dhcp server with /etc/init.d/dhcpd start • Stop dhcp server with /etc/init.d/dhcpd stop • Reload dhcp server with /etc/init.d/dhcpd restart • DHCP can be used with DNS for dynamic DNS