Build a DHCP service on linux

Source: Internet
Author: User

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

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.