DHCP server configuration

Source: Internet
Author: User
DHCP server configuration-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Configuration of the Linx DHCP server

DHCP server configuration
I. Basic concepts of DHCP
1. DHCP Definition
DHCP <动态主机配置协议> Is a seed protocol provided by TCP/IP, which works at the application layer. Provides automatically assigned IP configuration information.
2. DHCP Functions
① Dynamic Allocation (each IP Address has a lease ).
② Allocate gateway, WINS, and DNS system information.
③ Dynamic updates are implemented in combination with DNS.
④ Specify the IP address to the specific Nic.
3. DHCP Architecture
DHCP server: the host that runs the DHCP service package and DHCP protocol.
DHCP client: the host that runs the DHCP protocol to send DHCP requests.
(WIN2K, WINNT, WIN95/98/ME/XP, LINUX, UNIX)
Ii. How DHCP works
1. IP Address Allocation Process
① The CLIENT sends the broadcast DHCPDISCOVER to find the DCHP server.
② The server sends a broadcast DHCPOFFER to respond to the CLIENT's request.
③ The CLIENT checks whether the obtained IP information is complete and sends a broadcast DHCPREQUEST to notify the DHCP server that the IP address has been obtained.
④ The SERVER sends the broadcast DHCPACK to confirm the client's request, indicating that the allocation is successful.
2. Update the lease
① 50%, the CLIENT sends a DHCPREQUEST request to the server to update the lease.
② When the CLIENT sends a broadcast DHCPREQUEST to find that updates from other DHCP servers are successful, the DHCP server sends a DHCPACK message to the CLIENT if the DHCPACK fails.
Iii. DHCP service configuration
1. Install the DHCP service package
# Mount/dev/cdrom
# Cd/mnt/cdrom/RedHat/RPMS
# Ls dhcp *
# Rpm? Ivh dhcp (you can add by TAB)
Related Files And Directories:
/Var/lib/dhcp Directory: stores lease files.
/Etc/dhcpd. conf: the Core configuration file, which must be created manually.
/Var/lib/dhcp/dhcpd. lease: the database file of the customer lease.
/Etc/sysconfig/dhcpd: Configure DHCP startup parameters.
/Etc/sysconfig/dhcrelay: configure the DHCP relay proxy.
2./etc/dhcpd. conf
# Vi dhcpd. conf
Format:
Global Options (above Declaration)
Statement {
Option (valid only for declarations)
}
Option:
Global Options:
Ddns-update-style (none | ad-hoc | interim): defines the dynamic update type.
Options routers Host IP: defines the gateway.
Options domain-name-servers Host IP Address: defines the DNS server address of the client.
Options broudeast-addres: defines the broadcast address.
Options domain-name "domain name": defines the suffix domain name.
Default-lease-time number: defines the Default lease.
Max-lease-time number: defines the maximum lease time.
Common statements
Subnet network Subnet mask
{
Select
Starting IP address of Range, ending IP Address
}
Statement
Host Name {
Option host-name "host name"
Hardware Ethernet MAC address
Fixed-address IP address
}
Dhcp server configuration
# Rpm? Ivh dhcp3.op11. i386.rpm
# Vi/etc/dhcpd. conf
Ddns-update-style none;
Subnet 192.168.0.1 netmask 255.255.255.0
{
Default-lease-time 1200;
Max-lease-time 21000;
Option routers 192.168.0.1;
Option domain-man-server 211.162.0.1
Range 192.168.0.2 192.168.0.254
{
Subnet 211.162.11.0 netwask 255.255.255.0
}
}
# Touch/var/lib/dhcp/dhcpd. lease
# Vi/etc/sysconfig/dhcpd
DHCPDARGS = ETH1
#/Etc/rc. d/init. d/dhcpd restart

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.