いちからやり直し、、、(28)DHCP サーバ

Debian HS-DHGL

延長対応ハック de ダブルまる録!! 外部チューナコントロールつき が動くようになったので、ホームサーバとしてのいろいろ細かな設定を進めていく。

次は、DHCP サーバ
我が家の PC やガジェットは 全部 DHCP で固定的に IP アドレスを割り当てている。

パッケージのインストール

さて、どのパッケージをインストールすれば良いのやら。
slam:~# apt-cache search dhcp
autodns-dhcp - Automatic DNS updates for DHCP
avahi-autoipd - Avahi IPv4LL network address configuration daemon
backuppc - high-performance, enterprise-grade system for backing up PCs
bootp - server for the bootp protocol with DHCP support
dhcdbd - D-Bus interface to the ISC DHCP client
dhcp-helper - A DHCP relay agent
dhcpcd - DHCP client for automatically configuring IPv4 networking
dhcpdump - Parse DHCP packets from tcpdump
dhcping - DHCP Daemon Ping Program
dhis-server - Dynamic Host Information System - server	:
	:
dhcp-client - DHCP client transitional package
dhcp3-client - DHCP client
dhcp3-common - common files used by all the dhcp3* packages
dhcp3-dev - API for accessing and modifying the DHCP server and client state
dhcp3-relay - DHCP relay daemon
dhcp3-server - DHCP server for automatic IP address assignment
dhcp3-server-ldap - DHCP server able to use LDAP as backend
slam:~#
dhcp3-server らしい。
インストールする。
slam:~# apt-get install dhcp3-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  dhcp3-server-ldap
The following NEW packages will be installed:
  dhcp3-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 339kB of archives.
After this operation, 741kB of additional disk space will be used.
Get:1 http://security.debian.org lenny/updates/main dhcp3-server 3.1.1-6+lenny2 [339kB]
Fetched 339kB in 3s (106kB/s)
Preconfiguring packages ...

Package configuration



 lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu DHCP Server tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
 x                                                                           x
 x Non-authoritative version of DHCP server                                  x
 x                                                                           x
 x The version 3 DHCP server is non-authoritative by default.                x
 x                                                                           x
 x This means that if a client requests an address that the server knows     x
 x nothing about and the address is incorrect for that network segment, the  x
 x server will _not_ send a DHCPNAK (which tells the client it should stop   x
 x using the address). If you want to change this behavior, you must         x
 x explicitly state in dhcpd.conf what network segments your server is       x
 x authoritative for using the 'authoritative' statement.                    x
 x                                                                           x
 x                                  <Ok>                                     x
 x                                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj



Selecting previously deselected package dhcp3-server.
(Reading database ... 12656 files and directories currently installed.)
Unpacking dhcp3-server (from .../dhcp3-server_3.1.1-6+lenny2_armel.deb) ...
Processing triggers for man-db ...
Setting up dhcp3-server (3.1.1-6+lenny2) ...
Generating /etc/default/dhcp3-server...
Starting DHCP server: dhcpd3check syslog for diagnostics. failed!
 failed!
invoke-rc.d: initscript dhcp3-server, action "start" failed.
slam:~#
failed ?

DHCP サーバのセットアップ

dhcpd.conf を確認する。
slam:~# less /etc/dhcp3/dhc[TAB][TAB]
dhclient-enter-hooks.d/ dhclient.conf
dhclient-exit-hooks.d/  dhcpd.conf
slam:~# less /etc/dhcp3/dhc
おー。/etc/dhcp3/ か。
slam:~# less /etc/dhcp3/dhcpd.conf
	:
	:
これなら、旧型 HS-DHGL のをコピーしても良さそう。
slam:/etc/dhcp3# mv dhcpd.conf{,.orig}
slam:/etc/dhcp3# ftp sil
Connected to sil.
220 sil FTP server (GNU inetutils 1.5) ready.
Name (sil:yasunari):
331 Password required for yasunari.
Password:
230- Linux sil 2.6.16.16-arm1 #6 Fri Aug 31 13:07:15 JST 2007 armv5tejl
230-
230- The programs included with the Debian GNU/Linux system are free software;
230- the exact distribution terms for each program are described in the
230- individual files in /usr/share/doc/*/copyright.
230-
230- Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
230- permitted by applicable law.
230 User yasunari logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /etc/
250 CWD command successful.
ftp> get dhcpd.conf
local: dhcpd.conf remote: dhcpd.conf
200 PORT command sucessful.
150 Opening BINARY mode data connection for 'dhcpd.conf' (4904 bytes).
226 Transfer complete.
4904 bytes received in 0.00 secs (6642.2 kB/s)
ftp> bye
221 Goodbye.
slam:/etc/dhcp3#
dhcpd.conf は
slam:/etc/dhcp3# less dhcpd.conf
subnet 192.168.2.0 netmask 255.255.255.0 {
# --- default gateway
        option routers                  192.168.2.1;
        option subnet-mask              255.255.255.0;

        option domain-name              "yamasita.jp";
        option domain-name-servers      192.168.2.39, 192.168.1.2;

        option ntp-servers              ntp.yamasita.jp;

        range dynamic-bootp 192.168.2.200 192.168.2.209;
        default-lease-time 21600;
        max-lease-time 43200;

このあとに IP 固定の設定が全台分書いてある。
	:
	:
# 192.168.2.49 LS-XHL
host brick {
        hardware ethernet 00:1d:73:e4:48:df;
        fixed-address 192.168.2.49;
}
	:
	:
}

DHCP サーバの起動

slam:/etc/dhcp3# /etc/init.d/dhcp3-server start
Starting DHCP server: dhcpd3.
slam:/etc/dhcp3#

DHCP サーバの動作確認

/var/log/daemon.log を監視しながら、 ジャンクの LS-XHL の電源を入れる。
slam:/etc/dhcp3# tail -f /var/log/daemon.log
	:
	:
Jul 26 21:05:41 slam dhcpd: DHCPREQUEST for 192.168.2.49 from 00:1d:73:e4:48:df via eth0
Jul 26 21:05:41 slam dhcpd: DHCPACK on 192.168.2.49 to 00:1d:73:e4:48:df via eth0
ま、それなりに動いてそう。


HS-DHGL
バッファローダイレクト
楽天市場
Yahoo!ショッピング
ValuMore!
ムラウチドットコム


玄箱の新型が近日出荷
ハックの記録
LinkStation/玄箱 をハックしよう

いちからやり直し、、、(29)DNS スレーブサーバ

Copyright (C) 2003-2009 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市