linux:dhcp

文書の過去の版を表示しています。


DHCPサーバー

$ sudo yum install dhcp

設定前にバックアップを作成しておく。

$ sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.org

サンプルを元に修正する場合は、以下のファイルをコピーする。

$ sudo cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf

設定ファイルの編集。

$ sudo vi /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see 'man 5 dhcpd.conf'
#
 
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.fireball.local, 192.168.1.254;
 
    option ntp-servers blue-dc.fireball.local;
    option time-offset 32400;
#    option netbios-name-servers 192.168.1.10;
#    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;
#}

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
  • linux/dhcp.1381384165.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)