DHCP in Linux from entry to proficient Series

Source: Internet
Author: User

First, let's talk about dhcp:

For those who do not know much about network technology, configuring TCP/IP may be a very complicated task. For those who connect a PC to a LAN, they can only concentrate their configurations on the server, this simplifies the complexity of the client. Of course, this will increase the workload of the Administrator to a certain extent, but it is optimal from the overall consideration.

In this chapter, I will introduce how to configure Dynamic IP Address Allocation and Management, and explain how it works in easy-to-understand languages. I hope you can quickly become a qualified network administrator by reading this chapter. DHCP stands for the Dynamic Host Configuration Protocol (Dynamic Host Configuration Protocol), designed by the IETF (Internet network engineer Task Team). The detailed Protocol content is in RFC documents rfc2131 and rfc1541. The objective is to reduce the planning, management, and maintenance burden of TCP/IP networks and solve the problem of insufficient IP address space. The server running DHCP sets up the TCP/IP network and dynamically processes the IP Address Configuration of the workstation. The DHCP lease is associated with the preset IP address, the DHCP lease provides a mechanism to automatically and securely allocate and lease IP addresses on TCP/IP networks to achieve centralized IP address management without human intervention from network administrators. In addition, DHCP is designed as an extension of BOOTP (self-lifting Protocol). It supports diskless workstations that require network configuration information and provides corresponding support for systems that require fixed IP addresses.

The following describes the required resources:
Installation package, I use here is the built-in dhcp-2.0-5.i386.rpm of course you can go to the source package, you can also install yum at will. The system I use here is CentOS.

The configuration file is stored in the/etc/dhcpd. conf system and configured by the Administrator.
/Var/state/dhcp/dhcpd. leases system does not exist. The Administrator creates

Configure the dhcp service as follows:

1./etc/dhcpd. conf

Description: dhcp master configuration file
Source file:
Subnet 192.168.0.0 netmask 255.255.255.0 {# specify the network segment and subnet mask
Option routers 192.168.0.1; # specify the default route
Option subnet-mask limit 255.0; # specify the dhcp subnet mask
Option domain-name "weboa.com.cn"; # specify the domain name
Option domain-name-servers 192.168.0.1; # default DNS Server
Range dynamic-bootp 192.168.0.10 192.168.0.250; # IP Address allocation range
Default-lease-time 1200; # If the client cannot request a specified lease period
This parameter is used to define the lease duration of the address.
Max-lease-time 87600; # used to specify the maximum lease time, although
The duration is determined by the client's request.
# We want the nameserver to appear at a fixed address
# Host ns {
# Next-server marvin.RedHat.com;
# Hardware ethernet 12: 34: 56: 78: AB: CD;
# Fixed-address 207.175.42.254;
#}
}
# The comment above is used to assign a permanent IP address to the client, that is, it can be used
Bind the NIC and IP address

2./var/state/dhcp/dhcpd. leases

Description: IP Address Allocation record file
Run touch/var/state/dhcp/dhcpd. leases to generate
Source file:
Null


Test and management methods:

Test method;

1. After the Administrator modifies the configuration file, run/etc/rc. d/init. d/dhcpd restart.
To make the change take effect.
2. on Windows 98 client, you need to configure TCP/IP to automatically search for IP addresses.
3. On the Windows 98 client, you can run winipcfg to dynamically apply for an IP address.
4. The administrator can view the/var/state/dhcp/dhcpd. leases file to supervise the allocation of IP resources.


Management Method:

1. You can run tail-f/var/state/dhcp/dhcpd. leases to monitor IP Address allocation.

Summary:

After studying this chapter, you must feel that the DHCP configuration is very simple. To a certain extent, this is because I want to introduce a master server with a subnet, which is the simplest network topology. If it is more complex with multiple subnets, it is more troublesome to configure it. Therefore, you need to configure a relay proxy (dhcrelay) for each subnet. Its documentation can be found in Linux.

Build a DHCP server in Linux

Configure the master-slave DNS server and DDNS under DHCP in CentOS

SUSE Linux 11 pxe + DHCP + tftp + ftp Unattended Installation

How to Set up a DHCP server in Linux

Step-by-step implementation of DHCP server in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.