Introduction.
DHCP (acronym for Dynamic Host Configuration Protocol which translates Dynamic Server Configuration Protocol) is a protocol that allows individual devices on a network of IP addresses to obtain their own network configuration information (IP address; subnet mask, gateway, etc.) from a DHCP server. Its main purpose is to make large networks easier to manage. DHCP It has existed since 1993 as a standard protocol and is described in detail in the RFC 2131.
Without the help of a server DHCP, each IP address of each host that belongs to a Local Area Network would have to be configured manually. If a host moves to another location where there is another Local Area Network, a different IP address will have to be configured in order to join this new Local Area Network. A server DHCPit then monitors and distributes the IP addresses of a Local Area Network by assigning an IP address to each host that joins the Local Area Network. When, for example, a laptop is configured to use DHCP, it will be assigned an IP address and other network parameters necessary to join each Local Area Network where it is located.
There are three allocation methods in the protocol DHCP:
• | Manual assignment: The mapping uses a table with addresses MAC (acronym for MediaTOccess Control TOddress, which translates to Media Access Control address). Only hosts with one address MAC defined in said table will receive the IP assigned in the same table. This is done through the parameters ethernet hardware Y fixed-address. |
• | Automatic assignment: An available IP address within a certain range is permanently assigned to the host that requires it. |
• | Dynamic allocation: A range of IP addresses is arbitrarily determined and each host connected to the network is configured to request its IP address from the server when the network device starts, using a controllable time interval (parameters default-lease-time Y max-lease-time) so that IP addresses are not permanent and are dynamically reused. |
Necessary logical support.
It is required to install the dhcp package which should be included in the installation disks of most distributions.
yum -y install dhcp |
If you are using Red Hat ™ Enterprise Linux, all you need to do is do the following to install or update the necessary software:
up2date -i dhcp |
Configuration file.
Considering as an example that you have a local network with the following characteristics:
• | Network number 192.168.0.0 |
• | Subnet mask: 255.255.255.0 |
• | Gateway: 192.168.0.1 |
• | Name server: 192.168.0.1, 148.240.241.42 and 148.240.241.10 |
• | Wins Server: 192.168.0.1 |
• | Time servers: 66.187.224.4 and 66.187.233.4 |
• | Range of IP addresses to be assigned dynamically: 192.168.0.11-192.168.0.199 |
NOTE: It's essential know and understand perfectly all of the above in order to continue with this manual.
You can use the following content to create from scratch the file /etc/dhcpd.conf.
ddns-update-style interim; ignore client-updates; shared-network miredlocal {subnet 192.168.0.0 netmask 255.255.255.0 {option routers 192.168.0.1; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; option domain-name "redlocal.net"; option domain-name-servers 192.168.0.1, 148.240.241.42, 148.240.241.10; option netbios-name-servers 192.168.0.1; option ntp-servers 66.187.224.4, 66.187.233.4; range 192.168.0.11 192.168.0.199; default-lease-time 21600; max-lease-time 43200;} host m253 {option host-name "m253.redlocal.net"; hardware ethernet 00: 50: BF: 27: 1C: 1C; fixed-address 192.168.0.253 ;} host m254 {option host-name "m254.redlocal.net"; hardware ethernet 00: 01: 03: DC: 67: 23; fixed-address 192.168.0.254;}} |
A good security measure is to make the dhcpd service only work through the network interface used by the LAN, this in the case of having multiple network devices. Edit the file / etc / sysconfig / dhcpd and add as parameter argument DHCPDARGS the value eth0, eth1, eth2, etc., or whatever applies. Example, considering that eth0 is the interface corresponding to the LAN:
# Command line options here DHCPDARGS = eth0 |
To run the service for the first time, run:
/ sbin / service dhcpd start |
To make the changes made to the configuration take effect, run:
/ sbin / service dhcpd restart |
To stop the service, run:
/ sbin / service dhcpd stop |
To add dhcpd at system boot, run:
/ sbin / chkconfig dhcpd on |
Once this is done, it will only be enough to configure the workstations that are necessary as DHCP interfaces, regardless of the operating system they use.
Fountain:
http://unidadlocal.com/
No Comment