私は this チュートリアルに従って、CDリーダーもUSBブート機能も備えていないシステムにLinuxをインストールします。結局、私はisc-dhcp-server
をインストールしなければならないようになりました。
Apt
は、部分的にインストールされたパッケージが1つあることを示しています。 Sudo apt-get install -f
を実行すると、次のようになります。
Job for isc-dhcp-server.service failed. See 'systemctl status isc-dhcp server.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.
dpkg: error processing package isc-dhcp-server (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
isc-dhcp-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
/etc/init.d/isc-dhcp-server start
を実行すると、プロンプトは同じメッセージの最初の2行で構成されます。
Sudo systemctl status isc-dhcp-server
からの出力:
● isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server)
Active: failed (Result: exit-code) since Fri 2014-12-12 13:19:25 CST; 2min 43s ago
Process: 1677 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
Dec 12 13:19:23 semplice dhcpd[1684]: you want, please write a subnet declaration
Dec 12 13:19:23 semplice dhcpd[1684]: in your dhcpd.conf file for the network segment
Dec 12 13:19:23 semplice dhcpd[1684]: to which interface eth0 is attached. **
Dec 12 13:19:23 semplice dhcpd[1684]:
Dec 12 13:19:23 semplice dhcpd[1684]:
Dec 12 13:19:25 semplice isc-dhcp-server[1677]: Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed!
Dec 12 13:19:25 semplice isc-dhcp-server[1677]: failed!
Dec 12 13:19:25 semplice systemd[1]: isc-dhcp-server.service: control process exited, code=exited status=1
Dec 12 13:19:25 semplice systemd[1]: Failed to start LSB: DHCP server.
Dec 12 13:19:25 semplice systemd[1]: Unit isc-dhcp-server.service entered failed state.
Sudo journalctl -xn
からの出力:
-- Logs begin at Fri 2014-12-12 12:57:16 CST, end at Fri 2014-12-12 13:32:01 CST. --
Dec 12 13:31:58 semplice NetworkManager[505]: <info> lease time 86400
Dec 12 13:31:58 semplice NetworkManager[505]: <info> nameserver '192.168.1.254'
Dec 12 13:31:58 semplice NetworkManager[505]: <info> domain name 'lan'
Dec 12 13:31:58 semplice dbus[518]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.ser
Dec 12 13:31:58 semplice dbus[518]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Dec 12 13:31:58 semplice nm-dispatcher[2194]: Dispatching action 'dhcp4-change' for wlan0
Dec 12 13:31:58 semplice dhclient[616]: bound to 192.168.1.65 -- renewal in 45 seconds.
Dec 12 13:31:58 semplice NetworkManager[505]: bound to 192.168.1.65 -- renewal in 45 seconds.
Dec 12 13:32:01 semplice Sudo[2197]: alejandro : TTY=pts/0 ; PWD=/home/alejandro ; USER=root ; COMMAND=/bin/journalctl -xn
Dec 12 13:32:01 semplice Sudo[2197]: pam_unix(Sudo:session): session opened for user root by alejandro(uid=0)
これ は私の/etc/dhcp/dhcpd.config
ファイルで、上記のチュートリアルの例のコピーにすぎません。
/var/log/syslog
からの出力apt-get install -f
の実行直後に読み取られます
Dec 12 16:42:40 localhost dhclient: DHCPREQUEST on wlan0 to 192.168.1.254 port 67
Dec 12 16:42:40 localhost NetworkManager[505]: DHCPREQUEST on wlan0 to 192.168.1.254 port 67
Dec 12 16:42:40 localhost dhclient: DHCPACK from 192.168.1.254
Dec 12 16:42:40 localhost NetworkManager[505]: DHCPACK from 192.168.1.254
Dec 12 16:42:40 localhost NetworkManager[505]: <info> (wlan0): DHCPv4 state changed renew -> renew
Dec 12 16:42:40 localhost NetworkManager[505]: <info> address 192.168.1.65
Dec 12 16:42:40 localhost NetworkManager[505]: <info> plen 24 (255.255.255.0)
Dec 12 16:42:40 localhost NetworkManager[505]: <info> gateway 192.168.1.254
Dec 12 16:42:40 localhost NetworkManager[505]: <info> server identifier 192.168.1.254
Dec 12 16:42:40 localhost NetworkManager[505]: <info> lease time 86400
Dec 12 16:42:40 localhost NetworkManager[505]: <info> nameserver '192.168.1.254'
Dec 12 16:42:40 localhost NetworkManager[505]: <info> domain name 'lan'
Dec 12 16:42:40 localhost dbus[518]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Dec 12 16:42:40 localhost dbus[518]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Dec 12 16:42:40 localhost nm-dispatcher: Dispatching action 'dhcp4-change' for wlan0
Dec 12 16:42:41 localhost dhclient: bound to 192.168.1.65 -- renewal in 52 seconds.
Dec 12 16:42:41 localhost NetworkManager[505]: bound to 192.168.1.65 -- renewal in 52 seconds.
Dec 12 16:43:32 localhost dhclient: DHCPREQUEST on wlan0 to 192.168.1.254 port 67
Dec 12 16:43:32 localhost NetworkManager[505]: DHCPREQUEST on wlan0 to 192.168.1.254 port 67
Dec 12 16:43:32 localhost dhclient: DHCPACK from 192.168.1.254
Dec 12 16:43:32 localhost NetworkManager[505]: DHCPACK from 192.168.1.254
Dec 12 16:43:32 localhost NetworkManager[505]: <info> (wlan0): DHCPv4 state changed renew -> renew
Dec 12 16:43:32 localhost NetworkManager[505]: <info> address 192.168.1.65
Dec 12 16:43:32 localhost NetworkManager[505]: <info> plen 24 (255.255.255.0)
Dec 12 16:43:32 localhost NetworkManager[505]: <info> gateway 192.168.1.254
Dec 12 16:43:32 localhost NetworkManager[505]: <info> server identifier 192.168.1.254
Dec 12 16:43:32 localhost NetworkManager[505]: <info> lease time 86400
Dec 12 16:43:32 localhost NetworkManager[505]: <info> nameserver '192.168.1.254'
Dec 12 16:43:32 localhost NetworkManager[505]: <info> domain name 'lan'
Dec 12 16:43:32 localhost dbus[518]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Dec 12 16:43:32 localhost dbus[518]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Dec 12 16:43:32 localhost nm-dispatcher: Dispatching action 'dhcp4-change' for wlan0
Dec 12 16:43:33 localhost dhclient: bound to 192.168.1.65 -- renewal in 54 seconds.
Dec 12 16:43:33 localhost NetworkManager[505]: bound to 192.168.1.65 -- renewal in 54 seconds.
Dec 12 16:43:40 localhost dhcpd: Internet Systems Consortium DHCP Server 4.3.1
Dec 12 16:43:40 localhost dhcpd: Copyright 2004-2014 Internet Systems Consortium.
Dec 12 16:43:40 localhost dhcpd: All rights reserved.
Dec 12 16:43:40 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 12 16:43:40 localhost dhcpd: Internet Systems Consortium DHCP Server 4.3.1
Dec 12 16:43:40 localhost dhcpd: Copyright 2004-2014 Internet Systems Consortium.
Dec 12 16:43:40 localhost dhcpd: All rights reserved.
Dec 12 16:43:40 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 12 16:43:40 localhost dhcpd: Wrote 0 deleted Host decls to leases file.
Dec 12 16:43:40 localhost dhcpd: Wrote 0 new dynamic Host decls to leases file.
Dec 12 16:43:40 localhost dhcpd: Wrote 0 leases to leases file.
Dec 12 16:43:40 localhost dhcpd:
Dec 12 16:43:40 localhost dhcpd: No subnet declaration for eth0 (no IPv4 addresses).
Dec 12 16:43:40 localhost dhcpd: ** Ignoring requests on eth0. If this is not what
Dec 12 16:43:40 localhost dhcpd: you want, please write a subnet declaration
Dec 12 16:43:40 localhost dhcpd: in your dhcpd.conf file for the network segment
Dec 12 16:43:40 localhost dhcpd: to which interface eth0 is attached. **
Dec 12 16:43:40 localhost dhcpd:
Dec 12 16:43:40 localhost dhcpd:
Dec 12 16:43:40 localhost dhcpd: Not configured to listen on any interfaces!
Dec 12 16:43:40 localhost dhcpd:
Dec 12 16:43:40 localhost dhcpd: If you think you have received this message due to a bug rather
Dec 12 16:43:40 localhost dhcpd: than a configuration issue please read the section on submitting
Dec 12 16:43:40 localhost dhcpd: bugs on either our web page at www.isc.org or in the README file
Dec 12 16:43:40 localhost dhcpd: before submitting a bug. These pages explain the proper
Dec 12 16:43:40 localhost dhcpd: process and the information we find helpful for debugging..
Dec 12 16:43:40 localhost dhcpd:
Dec 12 16:43:40 localhost dhcpd: exiting.
Dec 12 16:43:42 localhost isc-dhcp-server[5729]: Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed!
Dec 12 16:43:42 localhost isc-dhcp-server[5729]: failed!
Dec 12 16:43:42 localhost systemd[1]: isc-dhcp-server.service: control process exited, code=exited status=1
Dec 12 16:43:42 localhost systemd[1]: Failed to start LSB: DHCP server.
Dec 12 16:43:42 localhost systemd[1]: Unit isc-dhcp-server.service entered failed state.
IPアドレスを非表示にする必要がありますか?
ネットワーク構成がdhcp.confのサブネット宣言と一致していないようです。 10.10.1.0/24サブネットのIPアドレスが構成されていることを確認してください。これは次の方法で確認できます。
ip a
そのようなIPアドレスが表示されない場合は、eに追加してみてください。 g。 eth0:
ip a a 10.10.1.200/24 dev eth0
その後、もう一度パッケージの修正を試みます。
apt-get install -f
私が正しい場合は、パッケージをインストールしてDHCPデーモンを起動する必要があります。このIPアドレスを/ etc/network/interfacesに永続化したい場合があります。
あなたの問題はここにあります:
Dec 12 16:43:40 localhost dhcpd: No subnet declaration for eth0 (no IPv4 addresses). Dec 12 16:43:40 localhost dhcpd: ** Ignoring requests on eth0. If this is not what Dec 12 16:43:40 localhost dhcpd: you want, please write a subnet declaration Dec 12 16:43:40 localhost dhcpd: in your dhcpd.conf file for the network segment Dec 12 16:43:40 localhost dhcpd: to which interface eth0 is attached. ** Dec 12 16:43:40 localhost dhcpd: Dec 12 16:43:40 localhost dhcpd: Dec 12 16:43:40 localhost dhcpd: Not configured to listen on any interfaces! Dec 12 16:43:40 localhost dhcpd: Dec 12 16:43:40 localhost dhcpd: If you think you have received this message due to a bug rather Dec 12 16:43:40 localhost dhcpd: than a configuration issue please read the section on submitting Dec 12 16:43:40 localhost dhcpd: bugs on either our web page at www.isc.org or in the README file Dec 12 16:43:40 localhost dhcpd: before submitting a bug. These pages explain the proper Dec 12 16:43:40 localhost dhcpd: process and the information we find helpful for debugging.. Dec 12 16:43:40 localhost dhcpd: Dec 12 16:43:40 localhost dhcpd: exiting.
dhcpd -t -cf /etc/dhcp/dhcpd.conf
を実行すると、エラーメッセージを再現できるはずです。
以下のトポロジー図のように、イーサネット上の他のホストへのワイヤレスインターネット接続を共有したいと思います。
↑
│ Uplink
│
┌────────────┴────────────┐
│ wlan0 │
│ 192.168.1.65/24 │
│ │
│ semplice │
│ │
│ 10.10.1.1/24 │
│ eth0 │
└────────────┬────────────┘
│
┌──────────────┬───────┴────────┬──────────────┐
│ │ │ │
Host 1 Host 2 Host 3 Host 4
10.10.1.21 10.10.1.22 10.10.1.23 10.10.1.24
サーバーのeth0
のアドレスは10.10.1.1であると想定しています。 ip addr show dev eth0
を実行して確認します。
次に設定する必要があります/etc/dhcp/dhcpd.conf
eth0
インターフェースでアドレスを配布します。デフォルトでは、dhcpd
は何にも応答しないように構成されています。これは、誤って実行されている不正なDHCPサーバーが、アドレスを要求するホストにアドレスを渡すことによってネットワークに大混乱をもたらすためです。
/etc/dhcp/dhcpd.conf
では、次のようなスタンザが必要です。
subnet 10.10.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.1.255;
option routers 10.10.1.1;
pool {
range 10.10.1.21 10.10.1.254;
}
}
…authoritative
、domain-name
、domain-name-servers
、default-lease-time
などの宣言に加えて。 (必要に応じて調整します。ネットワークに必要な設定を知っているのはあなただけです。)
また、Debianの場合、/etc/default/isc-dhcp-server
を編集して設定する必要があります
INTERFACES="eth0"
サーバーがイーサネットポートでリッスンするようにします。 (wlan0
をリッスンしたくない場合は、ワイヤレスアクセスポイントがアドレスをワイヤレスクライアントに配布する必要があります。)