The previous article wrote about using CentOS as a router, and now I want the other VMS under ESXi to get the IP address of the route assignment by DHCP, then we need to build the DHCP service on the router machine:
Second, install DHCP
1. Yum install-y DHCP
Cd/usr/share/doc/dhcp-4.1.1/
Cp-ra dhcpd.conf.sample/etc/dhcp/dhcpd.conf
Vim/etc/dhcp/dhcpd.conf
Subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.100 192.168.1.200; Option routers 192.168.1.1; Option broadcast-address 192.168.1.255; Option Domain-name-servers 202.106.0.20,8.8.8.8;}
2. Start DHCP:
/ETC/INIT.D/DHCPD start
Log error: Can ' t chown new lease File:operation not permitted
Workaround: Modify the VIM/ETC/RC.D/INIT.D/DHCPD file
Modify these two parameters to:
User=root
Group=root
3. Start DHCP again:
/ETC/INIT.D/DHCPD start
Starting dhcpd: [OK]
4. Client testing:
Create a virtual machine under ESXi, the NIC is set to the same virtual network card mode as the DHCP server eth1: Get address mode is DHCP
This article is from the "david0512" blog, make sure to keep this source http://gjr0512.blog.51cto.com/6518687/1767924
DHCP server setup under CentOS 6.5