CentOS Stream 10
Sponsored Link

Dnsmasq : DHCP サーバーの設定2024/12/27

 

Dnsmasq 組み込みの DHCP 機能を有効にして DHCP サーバーの設定をします。

[1] Dnsmasq の設定です。
[root@dlp ~]#
vi /etc/dnsmasq.conf
# 184行目 : 貸し出すアドレスの範囲とリース期間を追記

dhcp-range=10.0.0.200,10.0.0.250,12h
# 354行目 : デフォルトゲートウェイ, NTP, DNS, サブネットマスクを定義

dhcp-option=option:router,10.0.0.1
dhcp-option=option:ntp-server,10.0.0.10
dhcp-option=option:dns-server,10.0.0.10
dhcp-option=option:netmask,255.255.255.0
[root@dlp ~]#
systemctl restart dnsmasq

[2] Firewalld を有効にしている場合は、DHCP サービスの許可が必要です。DHCP サーバー は [67/UDP] を使用します。
[root@dlp ~]#
firewall-cmd --add-service=dhcp

success
[root@dlp ~]#
firewall-cmd --runtime-to-permanent

success
[3]
以上で設定完了です。
DHCP クライアントを設定して、正常に IP アドレスが割り当てられるか確認します。
関連コンテンツ