DHCP server:
1. ip Address Resolution
2. assign an ip address to the client
Install the dhcp software package:
After installing the dhcp service package, the system cannot start by default.
3. The dhcp service configuration file does not exist. The cp template is required:
4. Almost all the configuration files of the dhcp service are annotated, so there are several valid lines:
Ddns-update-style interim;/* Dynamic dns update mode supported by dhcp */
Ignore client-updates;/* ignore client DNS dynamic updates */
Subnet 192.168.1.0 netmask 255.255.255.0 {/* scope CIDR Block */
Range 192.168.1.11 192.168.1.100;/* IP address segment range */
Option routers 192.168.1.1;/* gateway address */
Option subnet-mask limit 255.0;/* subnet mask */
Option domain-name "koumm.com";/* domain name */
Option domain-name-servers 192.168.1.1, 202.103.24.68;/* dns IP */
Option broadcast-address 192.168.16.255;/* broadcast address */
Default-lease-time 86400;/* rent period 1 day, seconds */
Max-lease-time 172800;/* maximum lease period of 2 days */
/* Bind the IP address of the pc1 host */
Host pc1 {
Hardware ethernet 00: a0: cc: cf: 9C: 14;/* Binding host MAC address */
Fixed-address 192.168.1.20;/* maximum lease period of 2 days */
}
Host pc2 {
Hardware ethernet 04: 20: c1: f8: 37: 11;
Fixed-address 192.168.1.30;
}
You can also use the dhcp service to update the DNS Service:
The client configuration is to change the ip address to dhcp for dynamic retrieval.
Delete/etc/dhcp/dhcpclient-eth0.conf files
Vim/etc/dhcp/dhcpclient. conf
There are no reference files for these lines of files, and only manual input is allowed.