我试图按照Adafruit的指示将pi设置为访问点。但是,由于某种原因,sudo apt-get install isc-dhcp-server
总是会失败。我看过此链接,但是在dhcpd.conf中定义了一个子网(来自Adafruit):
/etc/dhcp/dhcpd.conf
.
.
.
# range 10.0.29.10 10.0.29.230;
# }
#}
subnet 192.168.42.0 netmask 255.255.255.0 {
range 192.168.42.10 192.168.42.50;
option broadcast-address 192.168.42.255;
option routers 192.168.42.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
当我这样做时sudo apt-get install isc-dhcp-server
,我得到:
Generating /etc/default/isc-dhcp-server...
[FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... failed!
failed!
和
pi@raspberrypi ~ $ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
pi@raspberrypi ~ $ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
pi@raspberrypi ~ $ sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED \
> -j ACCEPT
pi@raspberrypi ~ $ sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
pi@raspberrypi ~ $ sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
pi@raspberrypi ~ $ sudo service hostapd start
[ ok ] Starting advanced IEEE 802.11 management: hostapd.
pi@raspberrypi ~ $ sudo service isc-dhcp-server start
[FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... failed!
failed!
/ var / log / syslog:
Jul 26 03:05:25 raspberrypi dhcpd: Wrote 0 leases to leases file.
Jul 26 03:05:25 raspberrypi dhcpd:
Jul 26 03:05:25 raspberrypi dhcpd: No subnet declaration for wlan0 (192.168.42.\
1).
Jul 26 03:05:25 raspberrypi dhcpd: ** Ignoring requests on wlan0. If this is n\
ot what
Jul 26 03:05:25 raspberrypi dhcpd: you want, please write a subnet declarati\
on
Jul 26 03:05:25 raspberrypi dhcpd: in your dhcpd.conf file for the network s\
egment
Jul 26 03:05:25 raspberrypi dhcpd: to which interface wlan0 is attached. **
Jul 26 03:05:25 raspberrypi dhcpd:
Jul 26 03:05:25 raspberrypi dhcpd:
Jul 26 03:05:25 raspberrypi dhcpd: Not configured to listen on any interfaces!
我该如何解决?