DHCP サーバーを構築する
DHCP サーバーパッケージをインストールする
DHCP サーバーパッケージ (dhcp) は、yum コマンドを使用してインストールしますので、パッケージ管理の設定が完了していることを確認して下さい。
[ Fedora 8 / Fedora 7 ]
[root@web ~]# yum install dhcp
DHCP サーバーの設定について
DHCP サーバーの機能に関するオプション設定は、/etc/dhcpd.conf ファイルを編集します。 しかし、dhcp パッケージをインストールした段階では、dhcpd.conf ファイルにオプション設定がされていないため、サンプルを使用してオプション設定を行います。
[ Fedora 8 / Fedora 7 ]
サンプルファイルをコピーする
[root@web ~]# cp -p /usr/share/doc/dhcp-[ バージョン ]/dhcpd.conf.sample /etc/dhcpd.conf
[root@web ~]# vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
ネットワーク環境のアドレスとサブネットマスクを設定
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
デフォルトルートの IP アドレス
option routers 192.168.0.1;
サブネットマスク
option subnet-mask 255.255.255.0;
#option nis-domain "domain.org";
ドメイン名
option domain-name "i2kt.com";
DNS サーバー IP アドレス
option domain-name-servers 192.168.0.201;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
リース領域の指定
range dynamic-bootp 192.168.0.101 192.168.0.200;
リース時間の指定
default-lease-time 43200; [ デフォルト : 12時間 ]
max-lease-time 86400; [ 最大リース時間 : 24時間 ]
# we want the nameserver to appear at a fixed address
#host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
#}
}
DHCP サーバーを起動する
パッケージをインストールした段階では、セキュリティを考慮しているため自動起動されません。 Fedora システムの再起動後に DHCP サーバーを起動するため、自動起動の設定を行います。
[ Fedora 8 / Fedora 7 ]
DHCP サーバーを起動する
[root@web ~]# /etc/rc.d/init.d/dhcpd start
dhcpd を起動中: [ OK ]
DHCP サーバーの自動起動を設定する
[root@web ~]# chkconfig dhcpd on
[root@web ~]# chkconfig --list dhcpd
dhcpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
dhcrelay サービスの停止
Fedora システム起動時に発生する dhcrelay サービス機能を停止します。 また、Fedora システムの再起動後にdhcrelay サービス機能が起動しないようにするため、自動起動の設定を変更します。
[ Fedora 8 ]
dhcrelay サービスを停止する
[root@web ~]# /etc/rc.d/init.d/dhcrelay stop
dhcrelay サービスの自動起動を解除する
[root@web ~]# chkconfig dhcrelay off
[root@web ~]# chkconfig --list dhcrelay
dhcrelay 0:off 1:off 2:off 3:off 4:off 5:off 6:off