What is DHCP and How to Configure it - Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee

Monday, September 29, 2014

What is DHCP and How to Configure it

Dynamic Host Configuration Protocol(DHCP)

The Dynamic Host Configuration Protocol(DHCP) is a standardized networking protocol used on Internet Protocol networks for dynamically distributing Ip Address automatic to Client or Host Systems. It will be Renew(Change) the Ip Address after 7 Days or 1 Week.

###Dynamic Host Configuration Protocol Daemon###
Features:
 1. Provides automatic configuration of IPv4 clients
  a. IPv4 address
  b. Subnet mask
  c. Default gateway
  d. DNS Servers
  e. NTP Servers
  f. WINS Servers

 2. Leases the addreses and related information based on predefined values:
  a. 1 day
  b. 1 week
  c. 1 month

 3. DHCP uses UDP protocol and layer-2 information to request/assign addresses

 4. DHCP Process - DORA
  a. Discovery - client broadcasts on the local subnet for a DHCP server
  b. Offer - returned by the DHCP server
  c. Request - formal address request by client
  d. Acknowledgement/Acceptance - Acknowledgement occurrs

Note: DHCPD records leases in: /var/lib/dhcpd/dhcpd.leases

Tasks:
 1. Install DHCP server
  a. yum -y install dhcp

 2. Configure: /etc/dhcpd.conf - primary config file

 3. Set service up to start when system boots
  a. chkconfig dhcpd on - 2345

 4. Disable service on 192.168.75.100 box
  a. rcdhcpd stop

 5. Start service on localhost:
  a. service dhcpd start

 6. Setup DHCP reservation
  a. Requires the MAC address of the client (00:0C:29:B5:16:92)
  b. Requires the 'fixed-address' - IPv4 address to map to the MAC address
  c. Optional 'option-*' are supported between host { } block
  d. service dhcpd restart - restart to effect changes

/etc/dhcpd.conf

Port Numbers
67 Bootp
68 DHCP

/usr/share/doc/dhcp-<version-number>/dhcpd.conf.sample

subnet 192.168.1.0 netmask 255.255.255.0 {
   # The range of IP addresses the server
   # will issue to DHCP enabled PC clients
   # booting up on the network

 range 192.168.1.201 192.168.1.220;
   # Set the amount of time in seconds that
   # a client may keep the IP address

 default-lease-time 86400;
 max-lease-time 86400;
   # Set the default gateway to be used by
   # the PC clients

 option routers 192.168.1.1;
   # Don't forward DHCP requests from this
   # NIC interface to any other NIC
   # interfaces

 option ip-forwarding off;
   # Set the broadcast address and subnet mask
   # to be used by the DHCP clients

 option broadcast-address 192.168.1.255;
 option subnet-mask 255.255.255.0;
   # Set the DNS server to be used by the
   # DHCP clients
   option domain-name-servers 192.168.1.100;
   # Set the NTP server to be used by the
   # DHCP clients

 option nntp-server 192.168.1.100;
   # If you specify a WINS server for your Windows clients,
   # you need to include the following option in the dhcpd.conf file:

 option netbios-name-servers 192.168.1.100;
   # You can also assign specific IP addresses based on the clients'
   # ethernet MAC address as follows (Host's name is "laser-printer":
   host laser-printer {
      hardware ethernet 08:00:2b:4c:59:23;
      fixed-address 192.168.1.222;
   }
}


Thanking You
Hope U Like it.......

Fedora 20 in Virtual box

Roboform in linux

Ubuntu server 12.04

Nagios 4.0.7

Oracle Linux 7