dhcp/service-install.sh

raw link view readme
1 systemctl start firewalld
2 systemctl enable firewalld
3 firewall-cmd --permanent --add-interface=eth0 --zone=public
4 firewall-cmd --permanent --add-service=dhcp --zone=public
5 firewall-cmd --reload
6
7 yum install dhcp -y
8
9 cat > /etc/dhcp/dhcpd.conf << EOF
10 option domain-name-servers 8.8.8.8;
11 option domain-search "example.net";
12 option routers 10.1.1.254;
13 default-lease-time 86400;
14 max-lease-time 86400;
15 ddns-update-style none;
16 authoritative;
17 log-facility local4;
18 subnet 10.1.0.0 netmask 255.255.0.0 {
19 range 10.1.100.50 10.1.100.200;
20 }
21 ##+ reservation
22 #host lab02 {
23 # hardware ethernet 00:15:5d:01:1f:38;
24 # fixed-address 10.1.1.30;
25 #}
26 EOF
27
28 systemctl start dhcpd
29 systemctl enable dhcpd
30