目次
文書の過去の版を表示しています。
DHCPサーバー
パッケージインストール
$ sudo dnf install dhcp
DHCP サーバーの設定
設定ファイルのバックアップ
$ sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.org
サンプルを元に修正する場合は、以下のファイルをコピーする。
$ sudo cp /usr/share/doc/dhcp-server/dhcpd.conf.example /etc/dhcp/dhcpd.conf
設定ファイルの編集
$ sudo vi /etc/dhcp/dhcpd.conf
# # DHCP Server Configuration file. # ddns-update-style interim; ignore client-updates; subnet 192.168.1.0 netmask 255.255.255.0 { authoritative; option routers 192.168.1.254; option subnet-mask 255.255.255.0; option domain-name "fireball.local"; option domain-name-servers blue-dc, tomoyan-wrt; option ntp-servers blue-dc; option time-offset 32400; # Japan Standard Time # option netbios-name-servers blue-dc; # option netbios-node-type 2; range dynamic-bootp 192.168.1.91 192.168.1.100; default-lease-time 21600; max-lease-time 43200; } #host blue-work-sv { # hardware ethernet 52:54:00:1D:7E:B2; # fixed-address 192.168.1.80; #}
設定ファイルのチェック
$ sudo dhcpd -t Internet Systems Consortium DHCP Server 4.2.5 Copyright 2004-2013 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
firewallの設定
dhcpサービスを許可する。
$ sudo firewall-cmd --permanent --add-service=dhcp success
設定を反映する。
$ sudo firewall-cmd --reload success
設定を確認する。(dhcpが含まれていること)
$ sudo firewall-cmd --list-services dhcp dhcpv6-client ipp-client mdns
サービス自動起動設定
$ sudo systemctl enable dhcpd.service
サービス起動
$ sudo systemctl start dhcpd.service