LTSPサーバの構築中にDHCPサーバの起動をミスったのでまとめてみた

UbuntuでLTSPサーバを作ってみた(id:hykt:20081030)」の話の関連。

$ sudo /etc/init.d/dhcp3-server start
 * Starting DHCP server dhcp3                                           [fail]

「がーん。なんでだよー。」と落ち込んでても仕方ないさー。

まず、ログを見てみた。

$ tail -100 /var/log/syslog | more
Oct XX XX:52:14 ubuntu-desktop dhcpd: Internet Systems Consortium DHCP Server V3.0.6
Oct XX XX:52:14 ubuntu-desktop dhcpd: Copyright 2004-2007 Internet Systems Consortium.
Oct XX XX:52:14 ubuntu-desktop dhcpd: All rights reserved.
Oct XX XX:52:14 ubuntu-desktop dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
Oct XX XX:52:14 ubuntu-desktop dhcpd: Wrote 0 leases to leases file.
Oct XX XX:52:14 ubuntu-desktop dhcpd: 
Oct XX XX:52:14 ubuntu-desktop dhcpd: No subnet declaration for eth0 (169.254.5.227).
Oct XX XX:52:14 ubuntu-desktop dhcpd: ** Ignoring requests on eth0.  If this is not what
Oct XX XX:52:14 ubuntu-desktop dhcpd:    you want, please write a subnet declaration
Oct XX XX:52:14 ubuntu-desktop dhcpd:    in your dhcpd.conf file for the network segment
Oct XX XX:52:14 ubuntu-desktop dhcpd:    to which interface eth0 is attached. **
Oct XX XX:52:14 ubuntu-desktop dhcpd: 
Oct XX XX:52:14 ubuntu-desktop dhcpd: 
Oct XX XX:52:14 ubuntu-desktop dhcpd: Not configured to listen on any interfaces!

「がびーん」DHCPサーバになるマシンのネットワーク設定が、DHCPを利用するようになってるじゃん。orz
…って、"No subnet declaration for eth0 (169.254.5.227)."というログで気付いた。(!_!)
というわけで、DHCPサーバのネットワーク設定を手動で行って、無事DHCPサーバが起動した。
めでたしめでたし。



ちなみに…。
LTSPサーバは、次のポートが開いている必要がある。

TCP:22 sshサーバ(sshd)
TCP:2000 ディスクサーバ(nbd-server)
UDP:67 DHCPサーバ(dhcp3-server)
UDP:69 TFTPサーバ(tftpd-hpa)

これは、nmapコマンドで調べられる。

uname@ubuntu-desktop:/etc/ltsp$ sudo nmap localhost

Starting Nmap 4.53 ( http://insecure.org ) at 2008-XX-XX XX:24 JST
Interesting ports on localhost (127.0.0.1):
Not shown: 1712 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
2000/tcp open  callbook

Nmap done: 1 IP address (1 host up) scanned in 1.309 seconds
uname@ubuntu-desktop:/etc/ltsp$ sudo nmap -sU localhost

Starting Nmap 4.53 ( http://insecure.org ) at 2008-XX-XX XX:24 JST
Interesting ports on localhost (127.0.0.1):
Not shown: 1485 closed ports
PORT     STATE         SERVICE
67/udp   open|filtered dhcps
69/udp   open|filtered tftp
5353/udp open|filtered zeroconf

Nmap done: 1 IP address (1 host up) scanned in 2.448 seconds

おしまい。