●設定
[root@ora12ee01 ~]# vi /etc/dhcp/dhcpd.conf
↓追加
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.200 192.168.100.210;
option domain-name-servers ora12ee01.oradomain;
option domain-name "oradomain";
option routers 10.0.3.2;
option broadcast-address 192.168.100.255;
default-lease-time 600;
max-lease-time 7200;
}
●起動
[root@ora12ee01 ~]# systemctl start dhcpd.service
[root@ora12ee01 ~]# systemctl status dhcpd.service
●テスト
[root@ora12ee01 ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
server-duid "\000\001\000\001#\372[\261\010\000'\001\366\201";
lease 192.168.100.200 {
starts 6 2019/02/16 05:57:46;
ends 6 2019/02/16 06:07:46;
cltt 6 2019/02/16 05:57:46;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 08:00:27:42:26:27;
client-hostname "apc01";
}
●確認
[root@apc01 ~]# ip a
4: enp0s9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:42:26:27 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.200/24 brd 192.168.100.255 scope global enp0s9
inet6 fe80::a00:27ff:fe42:2627/64 scope link
valid_lft forever preferred_lft forever