Skip to the content.

Cài đặt và cấu hình DHCP server trên Centos 7

1. Mô hình

DHCP Server:

2 máy DHCP client

2. Cấu hình trên server

DHCP server config file

Sample config file in /usr/share/doc/dhcp*/dhcpd.conf.sample

default-lease-time 600; max-lease-time 7200; authoritative; log-facility local7;

subnet 10.88.88.0 netmask 255.255.255.0 { option routers 10.88.88.2; option subnet-mask 255.255.255.0; option domain-name-servers 1.1.1.1; range 10.88.88.100 10.88.88.150; default-lease-time 600; max-lease-time 7200; }

host centos2 { hardware ethernet 00:0c:29:bc:87:13; fixed-address 10.88.88.111; }

- Lưu cấu hình 
- Khởi đồng và cấu hình enable cho dịch vụ dhcpd.

systemctl enable dhcpd systemctl start dhcpd



- Cấu hình trên client nhận dhcp
```sh 
# vim /etc/sysconfig/network-scripts/ifcfg-eth1


DEVICE=ens33
BOOTPROTO=dhcp
TYPE=Ethernet
ONBOOT=yes