DHCPをインストールする。
# yum -y install dhcp
/etc/dhcp/dhcpd.confに下記を追記する。
option domain-name "local.example.com";
subnet 10.0.2.0 netmask 255.255.255.0 {
range dynamic-bootp 10.0.2.110 10.0.2.119;
option routers 10.0.2.2;
option domain-name-servers 10.0.2.101,10.0.2.102;
default-lease-time 288000;
max-lease-time 576000;
}
ファイアウォールに例外を追加する。
# firewall-cmd --permanent --add-service=dhcp # firewall-cmd --reload
サービスを有効にして起動する。
# systemctl enable dhcpd # systemctl start dhcpd