Set up DHCP service on linux 1. install the required software package yum install DHCP * 2. manually compile the DHCP master configuration file/etc/dhcp/dhcpd. the configuration content of the conf file is as follows: ddns-update-style none; default-lease-time 600; max-lease-time 1200; option domain-name "ceshi.com "; option domain-name-servers 192.168.3.202; subnet 192.168.3.0 netmask 255.255.255.0 {range 192.168.3.190 192.168.3.210; option subnet-mask 255.255.255.0; option routers 192.168.3.253; host Server01 {hardw Are ethernet B0: 51: 8E: 01: 94: 86; fixed-address 192.168.3.202;} 3 No syntax error found in the Command test configuration [root @ ns1 ~] # Service dhcpd configtestSyntax: OK normal 4 enable the host port file vim/etc/sysconfig/dhcpd DHCPDARGS = eth0 to allow IP addresses to be allocated. Test the test result and obtain the IP address Mar 28 10:17:13 localhost dhcpd: DHCPREQUEST for 192.168.3.190 from 00: 23: 4d: dc: 36: 41 (home) via eth0Mar 28 10:17:13 localhost dhcpd: DHCPACK on 192.168.3.190 to 00: 23: 4d: dc: 36: 41 (home) via eth0Mar 28 10:18:53 localhost named-sdb [4247]: network unreachable resolving 'py .qlogo.cn/A/IN': 2001: dc7: 1000: 1 # 53Mar 28 10:19:48 localhost dhcpd: DHCPREQUEST for 192.168.0.163 from 18: 87: 96: a0: ec: 33 via eth0: ignored (not authoritative ). mar 28 10:22:13 localhost dhcpd: DHCPREQUEST for 192.168.3.190 from 00: 23: 4d: dc: 36: 41 (home) via eth0Mar 28 10:22:13 localhost dhcpd: DHCPACK on 192.168.3.190 to 00: 23: 4d: dc: 36: 41 (home) via eth0 successfully allocated to MAC: 00: 23: 4d: dc: 36: 41. Host DHCP relay allows different network hosts to obtain IP addresses allocated by DHCP servers across network segments, 1. install the DHCP service package yum-y install dhcp * 2. Enable the server's route forwarding function vim/etc/sysctl. conf. ipv4.ip _ forward = 0 to 1 enable use command to make the modification take effect sysctl-p 3 enable DHCP relay interface and DHCP server to modify file [root @ ns1 ~] # Vim/etc/sysconfig/dhcrelay # Command line options hereINTERFACES = "eth0 eth1" DHCPSERVERS = "192.168.3.202" 4 enable the Service/etc/init. d/dhcrelay restart