sil:~# apt-get update : : sil:~# apt-cache search dhcp : bootp - server for the bootp protocol with DHCP support : dhcp3-server - DHCP server for automatic IP address assignment : dnsmasq - A small caching DNS proxy and DHCP server : udhcpd - very small DHCP server : wide-dhcpv6-server - DHCPv6 server for automatic IPv6 hosts configuration : dhcp - DHCP server for automatic IP address assignment :どれをインストールして良いのやら、、、
dhcp かな。
sil:~# apt-get install dhcp Reading package lists... Done Building dependency tree... Done The following NEW packages will be installed: dhcp 0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded. Need to get 114kB of archives. After unpacking 340kB of additional disk space will be used. Get:1 http://ftp2.jp.debian.org proposed-updates/main dhcp 2.0pl5-19.5etch2 [114kB] Fetched 114kB in 0s (437kB/s) Selecting previously deselected package dhcp. (Reading database ... 14333 files and directories currently installed.) Unpacking dhcp (from .../dhcp_2.0pl5-19.5etch2_arm.deb) ... Setting up dhcp (2.0pl5-19.5etch2) ... Generating /etc/default/dhcp... Please note that if you are installing the DHCP server for the first time you need to configure it first. Please stop (/etc/init.d/dhcp stop) the DHCP server daemon, edit /etc/dhcpd.conf to suit your needs and particular configuration, and restart the DHCP server daemon (/etc/init.d/dhcp start). You also need to edit /etc/default/dhcp to specify the interfaces dhcpd should listen to. By default it listens to eth0. NOTE: dhcpd's messages are being sent to syslog. Look there for diagnostics messages. Starting DHCP server: dhcpd failed to start - check syslog for diagnostics. sil:~#
sil:~# /etc/init.d/dhcp stop Stopping DHCP server: dhcp. sil:~#
sil:~# cd /etc/ sil:/etc# mv dhcpd.conf{,.orig} (ftp でコピー) sil:/etc# ls -l dhcpd.conf* -rw-r--r-- 1 root root 3608 Nov 4 15:15 dhcpd.conf -rw-r--r-- 1 root root 3233 Oct 27 08:58 dhcpd.conf.orig sil:/etc#
sil:/etc# cat /etc/default/dhcp # Defaults for dhcp initscript # sourced by /etc/init.d/dhcp # installed at /etc/default/dhcp by the maintainer scripts # # This is a POSIX shell fragment # # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? # Separate multiple interfaces with spaces, e.g. "eth0 eth1". INTERFACES="" sil:/etc#何も書いてないが、By default it listens to eth0. なら問題なし?
sil:/etc# /etc/init.d/dhcp start Starting DHCP server: dhcpd failed to start - check syslog for diagnostics. sil:/etc#やっぱりあかん。
sil:/etc# less /var/log/messages : :何もでてない。
sil:/etc# less /var/log/daemon.log : : Nov 4 15:19:19 sil dhcpd: /etc/dhcpd.conf line 1: expecting a parameter or declaration. Nov 4 15:19:19 sil dhcpd: ddns-update-style Nov 4 15:19:19 sil dhcpd: ^ Nov 4 15:19:19 sil dhcpd: Configuration file errors encountered -- exiting Nov 4 15:19:19 sil dhcpd: exiting. sil:/etc#1行目が悪いと。
消して再起動
sil:/etc# vi /etc/dhcpd.conf : sil:/etc# /etc/init.d/dhcp start Starting DHCP server: dhcpd. sil:/etc# tail /var/log/daemon.log :今度はうまく動作したようだ。
sil:/var# tail -f /var/log/daemon.log : Nov 4 15:29:32 sil dhcpd: DHCPREQUEST for 192.168.1.24 from 00:07:40:e8:12:ea via eth0 Nov 4 15:29:32 sil dhcpd: DHCPACK on 192.168.1.24 to 00:07:40:e8:12:ea via eth0動いているかな。
subnet 192.168.1.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.1.1; option subnet-mask 255.255.255.0; option domain-name "yamasita.jp"; option domain-name-servers 192.168.1.30, 192.168.1.2; option ntp-servers 192.168.1.30, 192.168.1.2; range dynamic-bootp 192.168.1.121 192.168.1.129; default-lease-time 21600; max-lease-time 43200; host panerina { hardware ethernet 00:07:40:e8:12:ea; fixed-address 192.168.1.24; } host psp { hardware ethernet 00:02:c7:ce:16:88; fixed-address 192.168.1.52; } }実際は、家中の全マシンの MAC アドレスと IP アドレスが書いてある。
|
← PCastLink のインストール |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ 1テラバイトの大容量で低価格を実現したLAN接続ハードディスク”LinkStation(リンク・ステーション)”を発売 |