0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

DHCPサーバ構築メモ

Last updated at Posted at 2023-05-07

主流のipv6では必要が無いのであれですが。

1、dhcpサーバをインストールする

sudo yum -y install dhcp

2、dhcpサーバの設定をする

設定ファイルは/etc/dhcp/dhcpd.confです

sudo vi /etc/dhcp/dhcpd.conf

設定項目は割と大量にあります。

subnet 192.168.1.0 netmask 255.255.255.0 # 割り当てるネットワーク 
{
  range 192.168.1.1 192.168.1.50; # 割り当て開始アドレス 割り当て最終アドレス
  default-lease-time 貸出期間(); # デフォルトは43200秒(12時間)
  option domain-name-servers 192.168.1.100; # DNSサーバ
 host ホスト名 # クライアントで固定ipアドレスを使用
 {
  hardware ethernet 00:11:22:33:44:aa;  # ハードウェアタイプとMACアドレス
  fixed-address 192.168.1.80;  # 割り当てるipアドレス
 }
}

他にも大量にあります。

3、ファイアウォール設定

sudo firewall-cmd --zobe=public --add-service=dhcp --permanent
sudo firewall-cmd --reload

4、起動、自動起動設定

systemctl start dhcpd
systemctl enable dhcpd

クライアントからはdhclientコマンドでipを取得します

 

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?