ABe*_*ter 5 networking dhcp linux debian isc-dhcp
我尝试使用 hostapd 和 isc-dhcpd 设置 wifi 接入点,但 dhcp 服务器不起作用。conf 文件与我在本教程中找到的文件相同:[Hostapd:创建虚拟 Wifi 接入点的 Linux 方式][1] !!!!!好吧,我想我不会得到任何帮助,除了对我已经读过的文档没有有用的提示......!!!!
\n这是当我想使用命令“systemctl start isc-dhcp-server.service”或“service isc-dhcp-server start”启动它时收到的错误消息
\nJob for isc-dhcp-server.service failed because the control process exited with error code.\nSee "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.\nRun Code Online (Sandbox Code Playgroud)\n这是命令“systemctl status isc-dhcp-server.service”的输出:
\n> root@l0calh0st:~# systemctl status isc-dhcp-server.service \xe2\x97\x8f\n> isc-dhcp-server.service - LSB: DHCP server Loaded: loaded\n> (/etc/init.d/isc-dhcp-server; generated; vendor preset: disabled) \n> Active: failed (Result: exit-code) since Tue 2018-01-09 18:23:07 CET;\n> 3s ago\n> Docs: man:systemd-sysv-generator(8) Process: 3831 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited,\n> status=1/FAILURE)\n> \n> Jan 09 18:23:05 l0calh0st dhcpd[3842]: bugs on either our web page at www.isc.org or in the README file\n> Jan 09 18:23:05 l0calh0st dhcpd[3842]: before submitting a bug. These pages explain the proper\n> Jan 09 18:23:05 l0calh0st dhcpd[3842]: process and the information we find helpful for debugging..\n> Jan 09 18:23:05 l0calh0st dhcpd[3842]: \n> Jan 09 18:23:05 l0calh0st dhcpd[3842]: exiting.\n> Jan 09 18:23:07 l0calh0st isc-dhcp-server[3831]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!\n> Jan 09 18:23:07 l0calh0st isc-dhcp-server[3831]: failed!\n> Jan 09 18:23:07 l0calh0st systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1\n> Jan 09 18:23:07 l0calh0st systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.\n> Jan 09 18:23:07 l0calh0st systemd[1]: Failed to start LSB: DHCP server.\nRun Code Online (Sandbox Code Playgroud)\n这是命令“journalctl -xe”的输出
\nroot@l0calh0st:~# journalctl -xe\nJan 09 19:44:42 l0calh0st dhcpd[4212]: \nJan 09 19:44:42 l0calh0st dhcpd[4212]: \nJan 09 19:44:42 l0calh0st dhcpd[4212]: Not configured to listen on any interfaces!\nJan 09 19:44:42 l0calh0st dhcpd[4212]: \nJan 09 19:44:42 l0calh0st dhcpd[4212]: If you think you have received this message due to a bug rather\nJan 09 19:44:42 l0calh0st dhcpd[4212]: than a configuration issue please read the section on submitting\nJan 09 19:44:42 l0calh0st dhcpd[4212]: bugs on either our web page at www.isc.org or in the README file\nJan 09 19:44:42 l0calh0st dhcpd[4212]: before submitting a bug. These pages explain the proper\nJan 09 19:44:42 l0calh0st dhcpd[4212]: process and the information we find helpful for debugging..\nJan 09 19:44:42 l0calh0st dhcpd[4212]: \nJan 09 19:44:42 l0calh0st dhcpd[4212]: exiting.\nJan 09 19:44:44 l0calh0st isc-dhcp-server[4201]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!\nJan 09 19:44:44 l0calh0st isc-dhcp-server[4201]: failed!\nJan 09 19:44:44 l0calh0st systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1\nJan 09 19:44:44 l0calh0st systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.\nJan 09 19:44:44 l0calh0st systemd[1]: Failed to start LSB: DHCP server.\n-- Subject: Unit isc-dhcp-server.service has failed\n-- Defined-By: systemd\n-- Support: https://www.debian.org/support\n-- \n-- Unit isc-dhcp-server.service has failed.\n-- \n-- The result is RESULT.\nRun Code Online (Sandbox Code Playgroud)\n这是etc/dhcp/dhcpd.conf 文件:
\nddns-update-style none;\nignore client-updates;\nauthoritative;\noption local-wpad code 252 = text;\n\nsubnet\n10.0.0.0 netmask 255.255.255.0 {\n# --- default gateway\noption routers\n10.0.0.1;\n# --- Netmask\noption subnet-mask\n255.255.255.0;\n# --- Broadcast Address\noption broadcast-address\n10.0.0.255;\n# --- Domain name servers, tells the clients which DNS servers to use.\noption domain-name-servers\n10.0.0.1, 8.8.8.8, 8.8.4.4;\noption time-offset\n0;\nrange 10.0.0.3 10.0.0.13;\ndefault-lease-time 1209600;\nmax-lease-time 1814400;\n}\nRun Code Online (Sandbox Code Playgroud)\n这是 /etc/default/isc-dhcp-server 文件:
\n# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)\n\n# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).\n#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf\n#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf\n\n# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).\n#DHCPDv4_PID=/var/run/dhcpd.pid\n#DHCPDv6_PID=/var/run/dhcpd6.pid\n\n# Additional options to start dhcpd with.\n# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead\n#OPTIONS=""\n\n# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?\n# Separate multiple interfaces with spaces, e.g. "eth0 eth1".\nINTERFACESv4="wlan0"\nINTERFACESv6=""\nRun Code Online (Sandbox Code Playgroud)\n这是 /etc/network/interfaces 文件:(我不知道这是否重要)
\n # This file describes the network interfaces available on your system\n# and how to activate them. For more information, see interfaces(5).\n\nsource /etc/network/interfaces.d/*\n\n# The loopback network interface\nauto lo\niface lo inet loopback\n\n\nauto wlan0\niface wlan0 inet static\n address 10.0.0.14\n netmask 255.255.255.0\nRun Code Online (Sandbox Code Playgroud)\nifconfig 的输出:
\nroot@l0calh0st:~# ifconfig\neth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500\n inet 192.168.2.101 netmask 255.255.255.0 broadcast 192.168.2.255\n inet6 2003:50:ad02:a21:d455:ca81:501e:727a prefixlen 64 scopeid 0x0<global>\n inet6 fe80::da92:2698:1cc8:40d prefixlen 64 scopeid 0x20<link>\n ether 40:8d:5c:52:43:f4 txqueuelen 1000 (Ethernet)\n RX packets 4908 bytes 2441138 (2.3 MiB)\n RX errors 0 dropped 0 overruns 0 frame 0\n TX packets 5464 bytes 822466 (803.1 KiB)\n TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0\n device interrupt 16 memory 0xdf200000-df220000 \n\nlo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536\n inet 127.0.0.1 netmask 255.0.0.0\n inet6 ::1 prefixlen 128 scopeid 0x10<host>\n loop txqueuelen 1000 (Lokale Schleife)\n RX packets 188 bytes 14388 (14.0 KiB)\n RX errors 0 dropped 0 overruns 0 frame 0\n TX packets 188 bytes 14388 (14.0 KiB)\n TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0\n\nwlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500\n ether 36:58:48:6a:7b:16 txqueuelen 1000 (Ethernet)\n RX packets 0 bytes 0 (0.0 B)\n RX errors 0 dropped 0 overruns 0 frame 0\n TX packets 0 bytes 0 (0.0 B)\n TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0\nRun Code Online (Sandbox Code Playgroud)\n
您应该使用journalctl -xe(如错误消息所示)来获取有关错误实际内容的更多详细信息。
您可能需要翻箱倒柜才能找到它。或者,您可以journalctl -f在一个终端中运行并重新启动该服务,该服务应写入日志的尾部并在另一个终端中可见。
Jan 09 19:44:42 l0calh0st dhcpd[4212]:未配置为侦听任何接口!
^^^ 这就是你的问题。