Lab 2.2 - Install OKD Cluster - Setup DHCP Server

1. Install dhcp-server package on bastion host

dnf install dhcp-server -y

2. Configure DHCP Leases

mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak
vim /etc/dhcp/dhcpd.conf
...
ddns-update-style interim;
ignore client-updates;
authoritative;
allow booting;
allow bootp;
allow unknown-clients;

# internal subnet for my DHCP Server
subnet 10.6X.6X.0 netmask 255.255.255.0 {
range 10.6X.6X.200 10.6X.6X.210;
option domain-name-servers 10.6X.6X.3;
option routers 10.6X.6X.1;
option broadcast-address 10.6X.6X.255;
default-lease-time 600;
max-lease-time 7200;

host bootstrap.openshift.podX.io { hardware ethernet 52:54:00:f5:90:ad; fixed-address 10.6X.6X.4; }

host master1.openshift.podX.io { hardware ethernet 52:54:00:e4:72:ae; fixed-address 10.6X.6X.5; }
host master2.openshift.podX.io { hardware ethernet 52:54:00:21:29:c9; fixed-address 10.6X.6X.6; }
host master3.openshift.podX.io { hardware ethernet 52:54:00:12:c3:e1; fixed-address 10.6X.6X.7; }

host worker1.openshift.podX.io { hardware ethernet 52:54:00:79:95:86; fixed-address 10.6X.6X.8; }
host worker2.openshift.podX.io { hardware ethernet 52:54:00:0e:0a:db; fixed-address 10.6X.6X.9; }

deny unknown-clients;

![](/media/markdownx/145af491-dfdb-46ae-a1ab-1a28bab1b34c.png)# IP of PXE Server
next-server 10.6X.6X.3;
if exists user-class and option user-class = "iPXE" {

filename "http://helper.openshift.podX.io:8080/boot.ipxe";

} else {

filename "undionly.kpxe";

}
}
...

NOTE: Change the MAC Adresses with your own.

3. Restart and enable dhcp service

systemctl enable dhcpd
systemctl restart dhcpd
systemctl status dhcpd

4. Set firewall

firewall-cmd --add-service=dhcp --permanent
firewall-cmd --reload

Daftar Materi