DHCP server
Program Environment:
DHCP server:
/usr/sbin/dhcpd
IPV4 Network:
/etc/dhcp/dhcpd.conf
/usr/lib/systemd/system/dhcpd.service
IPV6 Network:
Etc/dhcp/dhcpd6.conf
/usr/lib/systemd/system/dhcpd6.service
Dhcrelay:
/usr/sbin/dhcrelay
/usr/lib/systemd/system/dhcrelay.service
The address and port of the listener:
Server:67/udp
Client:68/udp
Configuration file:/etc/dhcp/dhcpd.conf
Configuration directives:
Option options: Trust messages configured for the client
Directives: Defining the working characteristics of DHCP server
Configure a level of points:
Global configuration
Subnet configuration
Host Configuration
Common configurations:
Default-lease-time 600; #默认租期
Max-lease-time 7200; #全局租期
Option Domain-name "Search_domain.tld"; #定义搜索域
Option Domain-name-servers Dns_server1, Dns_server2, Dns_server3; #指明配置客户端的DNS Address (window has 2, Linux has 3)
Option Routers GW1, GW2, ...; #默认网关
Option Broadcast-address broadcast_address; #定义广播地址
Subnet NETWORK netmask MASK {
Range Start_ip end_ip;
} #定义网络作用域, which is a subnet, is mainly used to specify the address pool;
Host Passacaglia { #定义保留地址, fixed address (not in address pool)
Hardware Ethernet 0:0:c0:5d:bd:95;
Fixed-address ip_addr;
}
Other directives:
FileName: Indicates the name of the boot file;
Next-server: Indicates the host IP of the server on which the boot file resides;
FileName "pxelinux.0";
Next-server 10.1.0.6;
TFTP server
Experiment:
A DHCP server, IP 192.168.1.100, the address pool is 192.168.1.50-192.168.1.150, the other two hosts take the IP address automatically, one of the machine's IP address is the MAC binding, the address is 192.168.1.161
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/89/99/wKioL1gYDjTjRiNvAADbCwk6QlM973.jpg "title=" Dhcp1.jpg "alt=" Wkiol1gydjtjrinvaadbcwk6qlm973.jpg "/>
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/89/9B/wKiom1gYDrfSi4mpAABaJcX1_5E812.jpg "style=" float: none; "title=" dhcp2.jpg "alt=" Wkiom1gydrfsi4mpaabajcx1_5e812.jpg "/>
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/89/99/wKioL1gYDrihsxLyAAA4MfIoF2k206.jpg "style=" float: none; "title=" dhcp3.jpg "alt=" Wkiol1gydrihsxlyaaa4mfiof2k206.jpg "/>
This machine automatically gets the address 192.168.131, the gateway is 192.168.1.100
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/89/99/wKioL1gYD5OATOkYAACk7GgsiG8663.jpg "title=" Dhcp4.jpg "alt=" Wkiol1gyd5oatokyaack7ggsig8663.jpg "/>
This machine uses a bound MAC address for the IP address, note that the 161 address is not in the address pool
This article is from the "zebra930" blog, make sure to keep this source http://zebra930.blog.51cto.com/11736340/1868010
DHCP Server Setup