Linux DHCP installation-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Today, I will share with you how DHCP is implemented in linux.
I. first understand the concept of DHCP
DHCP is a network protocol that enables dynamic configuration such as Host IP address DNS.
DNCP can be implemented in a variety of operating systems, including the most common LINUX and WINDOWS systems
The structure of the dhcp network service has two roles: server and client.
The DHCP server is used to provide network configuration information for all DHCP clients in the network,
The DHCP server is usually unique in.
Any host in the network can be configured as a DHCP client to send configuration requests to the DHCP server and follow the service
Configure the network.
2. network configuration information that can be provided by the DHCP server
1. IP address and subnet mask of the network interface.
2. Network Address and broadcast address corresponding to the IP address of the Network Interface
3. default gateway address
4. DNS server address
Iii. DHCP server configuration
1. install DHCP server software (which includes the RPM-format DHCP server software package in the installation disc of RHEL4 system, the package file name is dhcp-3.0.1-12_EL.i386.rpm), on the 4th installation disc of RHEL4, other DHCP-related software packages are included in the same installation disk.
# Cd/media/cdrom/rehat/rpms/
# Ks-l dhcp *
Dhcp-3.0.1-12_EL.i386, rpm is not installed by default in REL4 and requires manual Installation
# Rpm-qa | grep dhcp
# Rpm-ivh dhcp-3.0.1-12_EL.i386.rpm
2. /usr/sbin/dhcpd is the execution file of the DHCP server,/etc/rc. d/init. d/dhcpd is the startup script of the DHCP server. Although the file names are all DHCPD, the file is located in different directories and has different functions.
The DHCPD. CONF configuration file and the format of the configuration file and configuration file
# Ls/etc/dhcp *
# Vi/etc/dhcpd. conf
For example:
Subnet 192.168.1.0 netmask 255.255.255.0 {
Range 192.168.1.100 192.168.1.200;
}
3. Global settings
Global settings are configuration items (parameters or options) that are not included in any declarations in the DHCPD. CONF configuration file ),
Applies to the entire configuration file. When no corresponding configuration item exists in the declaration, the global configuration item settings will be used.
When corresponding setting items exist, the setting in this Declaration is used, instead of the value of the global setting item.
Common global settings in the DHCP. CONF configuration file are as follows:
1) The ddns-update-style parameter is used to set the dynamic information update mode between the DHCP server and the DNS server.
2) The default lease time is set using the default-lease-time parameter. The unit of the parameter value is second.
3) use the max-lease-time parameter to set the maximum lease time. The unit of the parameter value is second.
4) The domain name of the host is set using the domain-name prefix. The domain name is composed of the host name.
Host full name
5) use the domain-name-servers option to set the DNS server address. The value is the IP address of the DNS server required by the DHCP client.
6) use the subnet declaration to set subnet attributes
Subnet is the most common declaration in the DHCP. CONF file. It is used to set the network attribute of the dynamically allocated address in the subnet. The subnet declaration may include other parameters.
4. Start and Stop the DHCP server and restart the \ and DHCP service status.
# Service dhcpd start
# Service dhcpd stop
# Service dhcpd restart
# Service dhcpd status
Iii. DHCP configuration instance
For example
The default lease time is 21600 S.
The maximum lease time is 43200 S.
The domain name of all hosts in the LAN is abc.com.
The IP address of the DNS server used by the client is 192.168.1.1.
The declared IP address range used for Dynamic Allocation in the subnet 192.168.1.0/24 is 192.168.1.100 ~~~ The subnet mask allocated for 192.168.1.200 is 255.255.255.0. The default gateway is 192.168.1.1.
There is a server host named server01 In the subnet 192.168.1.0/24, and the fixed assigned IP address is 192.168.1.1,
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