Linux as DHCP server 2

Source: Internet
Author: User
Article Title: Linux as DHCP server 2. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
2.4 dhcp ip Address Allocation Process
  
The DHCP Client initializes TCP/IP and broadcasts a DHCPDISCOVER message on the local physical subnet to determine the DHCP server bit.
And its IP address. If the DHCP server and the client are not in the same physical subnet, The BOOTP relay proxy forwards the message to the DHCP server. Since there may be more than one DHCP server on the network, all DHCP servers with valid IP address information will send a proposal to the client. The client selects IP address information from the first proposal received and broadcasts a message request for a lease address. The DHCP server that sends the proposal responds to the message, specifies the IP address information to the client, and sends a confirmation. All other DHCP servers recall their respective proposals. The client initializes and binds the TCP/IP protocol. After the configuration is complete, the client can use common network communication and all IP services and applications used to connect to other IP hosts.
  
Iii. Installation of DHCP server software
  
  
Almost all Linux systems use Paul Vixie/ISC DHCPd to implement DHCP server functions. Accessible
  
Http://www.isc.org/isc
  
Obtain the latest message.
  
At present, most of the books in Linux contain this software. If it is Red Hat and provided in RPM form, you only need to install it with RPM.
  
# Rpm-I dhcpd-1.3.17pl5-i386.rpm
  
Iv. Basic Applications
  
According to the current situation, most Linux DHCP servers provide services for the Windows 95/98 client platform.
  
1. Add Host Routing
  
  
To enable the DHCP server to serve the correct DHCP Client Machine in MS, you need to create a route to address 255.255.255.255 and add this route command to/etc/rc. d/rc. local to make the machine run automatically after each start.
  
# Route add-host route 255.255.255 dev eth0
  
In some old Linux core systems, error messages may be reported:
  
255.255.255.255: Unkown host
  
Try adding the following entries to the/etc/hosts file.
  
255.255.255.255 dhcphost
  
Use the following command
  
# Route add-host dhcphost dev eth0
  
2. modify the configuration file
  
The default configuration file/etc/DHCPd. conf of dhcpd is a text file. A syntax analyzer in DHCPd can perform syntax analysis on this file to obtain configuration parameters. The dhcpd. conf format is recursively degraded. The keywords are case sensitive and can be annotated. The comment starts with # until the end of the line. Here is a simple example of dhcpd. conf. The service network is Class C reserved network 192.168.1.0
  
# Examples
  
#? P> Linux DHCP server 2
  
Linuxaid technical support website 01-01-10 675 p wushubin
--------------------------------------------------------------------------------
  
  
  
2.4 dhcp ip Address Allocation Process
  
The DHCP Client initializes TCP/IP and broadcasts a DHCPDISCOVER message on the local physical subnet to determine the DHCP server bit.
And its IP address. If the DHCP server and the client are not in the same physical subnet, The BOOTP relay proxy forwards the message to the DHCP server. Since there may be more than one DHCP server on the network, all DHCP servers with valid IP address information will send a proposal to the client. The client selects IP address information from the first proposal received and broadcasts a message request for a lease address. The DHCP server that sends the proposal responds to the message, specifies the IP address information to the client, and sends a confirmation. All other DHCP servers recall their respective proposals. The client initializes and binds the TCP/IP protocol. After the configuration is complete, the client can use common network communication and all IP services and applications used to connect to other IP hosts.
  
Iii. Installation of DHCP server software
  
  
Almost all Linux systems use Paul Vixie/ISC DHCPd to implement DHCP server functions. Accessible
  
Http://www.isc.org/isc
  
Obtain the latest message.
  
At present, most of the books in Linux contain this software. If it is Red Hat and provided in RPM form, you only need to install it with RPM.
  
# Rpm-I dhcpd-1.3.17pl5-i386.rpm
  
Iv. Basic Applications
  
According to the current situation, most Linux DHCP servers provide services for the Windows 95/98 client platform.
  
1. Add Host Routing
  
  
To enable the DHCP server to serve the correct DHCP Client Machine in MS, you need to create a route to address 255.255.255.255 and add this route command to/etc/rc. d/rc. local to make the machine run automatically after each start.
  
# Route add-host route 255.255.255 dev eth0
  
In some old Linux core systems, error messages may be reported:
  
255.255.255.255: Unkown host
  
Try adding the following entries to the/etc/hosts file.
  
255.255.255.255 dhcphost
  
Use the following command
  
# Route add-host dhcphost dev eth0
  
2. modify the configuration file
  
The default configuration file/etc/DHCPd. conf of dhcpd is a text file. A syntax analyzer in DHCPd can perform syntax analysis on this file to obtain configuration parameters. The dhcpd. conf format is recursively degraded. The keywords are case sensitive and can be annotated. The comment starts with # until the end of the line. Here is a simple example of dhcpd. conf. The service network is Class C reserved network 192.168.1.0
  
# Examples
  
# Default lease time
  
Default-lease-time 28800;
  
# Maximum lease time
  
Max-lease-time 43200;
  
# Subnet mask options
  
Option subnet-mask limit 255.0;
  
# Broadcast address
  
Option broadcast-address 192.168.1.255;
  
# Vro address
  
Option routers 192.168.1.1;
  
# DNS address
  
Option dom2.4 dhcp ip Address Allocation Process
  
The DHCP Client initializes TCP/IP and broadcasts a DHCPDISCOVER message on the local physical subnet to determine the DHCP server bit.
And its IP address. If the DHCP server and the client are not in the same physical subnet, The BOOTP relay proxy forwards the message to the DHCP server. Since there may be more than one DHCP server on the network, all DHCP servers with valid IP address information will send a proposal to the client. The client selects IP address information from the first proposal received and broadcasts a message request for a lease address. The DHCP server that sends the proposal responds to the message, specifies the IP address information to the client, and sends a confirmation. All other DHCP servers recall their respective proposals. The client initializes and binds the TCP/IP protocol. After the configuration is complete, the client can use common network communication and all IP services and applications used to connect to other IP hosts.
  
Iii. Installation of DHCP server software
  
  
Almost all Linux systems use Paul Vixie/ISC DHCPd to implement DHCP server functions. Accessible
  
Http://www.isc.org/isc
  
Obtain the latest message.
  
At present, most of the books in Linux contain this software. If it is Red Hat and provided in RPM form, you only need to install it with RPM.
  
# Rpm-I dhcpd-1.3.17pl5-i386.rpm
  
Iv. Basic Applications
  
According to the current situation, most Linux DHCP servers provide services for the Windows 95/98 client platform.
  
1. Add Host Routing
  
  
To enable the DHCP server to serve the correct DHCP Client Machine in MS, you need to create a route to address 255.255.255.255 and add this route command to/etc/rc. d/rc. local to make the machine run automatically after each start.
  
# Route add-host route 255.255.255 dev eth0
  
In some old Linux core systems, error messages may be reported:
  
255.255.255.255: Unkown host
  
Try adding the following entries to the/etc/hosts file.
  
255.255.255.255 dhcphost
  
Use the following command
  
# Route add-host dhcphost dev eth0
  
2. modify the configuration file
  
The default configuration file/etc/DHCPd. conf of dhcpd is a text file. A syntax analyzer in DHCPd can perform syntax analysis on this file to obtain configuration parameters. The dhcpd. conf format is recursively degraded. The keywords are case sensitive and can be annotated. The comment starts with # until the end of the line. Here is a simple example of dhcpd. conf. The service network is Class C reserved network 192.168.1.0
  
# Examples
  
# Default lease time
  
Default-lease-time 28800;
  
# Maximum lease time
  
Max-lease-time 43200;
  
# Subnet mask options
  
Option subnet-mask limit 255.0;
  
# Broadcast address
  
Option broadcast-address 192.168.1.255;
  
# Vro address
  
Option routers 192.168.1.1;
  
# DNS address
  
Option domain-name-servers 192.168.1.1;
  
# Domain Name
  
Option domain-name "netreslab.org ";
  
# All the above are global Parameters
  
# Subnet description and mask
  
Subnet 192.168.1.0 netmask 255.255.255.0 {
  
# Range
Range 192.168.1.10 192.168.1.100;
  
# Range
  
Range 192.168.1.150 192.168.1.200;
  
}
  
This configuration file allows the DHCP server to allocate two IP ranges to DHCP clients, 192.168.1.10-100 and 192.168.1.150-200.
If the DHCP client does not request a specific lease expiration time when applying for a lease, the default-lease-time (28800 seconds) is used as the lease time. If a request for a specific lease expiration time is made, use max-lease-time (432000 seconds)
  
The server sends the following parameters to the DHCP client:
  
The subnet mask is 255.255.255.0, the broadcast address is 192.168.1.255, the default gateway is 192.168.1.1, And the DNS is 192.168.1.1.
  
If you want to specify a fixed IP address for a machine called hotdog, you can add

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.