Raspberry Pi零W蜜罐(类似于无线AP)

Raspberry Pi Zero W Honeypot (similar to Wireless AP)

我想通过 WiFi 访问 Raspberry Pi 零上的服务器。

YouTube Video describing the Problem

我正在按照 Raspberry Pi Blog 的教程进行操作。

用另一台笔记本电脑访问服务器不起作用。说没有连接。

当我在 Raspi运行

sudo cat /var/log/dnsmasq.log

最后我得到这个错误:

May 9 09:59:28 dnsmasq-dhcp[513]: no address range available for DHCP request via wlan0

但我不确定这是否与问题有任何关系。

如何使 Raspi Zero W http-Server(http 服务器是 raspi 上的服务器)可通过 WiFi 连接?

以下是文件的相关部分。

文件:/etc/network/interfaces

auto lo
iface lo inet loopback
iface eth0 inet dhcp

iface wlan0 inet static
address 10.0.0.1
netmask 255.255.255.0
broadcast 255.0.0.0
pre-up iptables-restore < /etc/iptables.rules

文件:/etc/dnsmasq.conf

#...
#at the end of the file
log-facility=/var/log/dnsmasq.log
address=/#/10.0.0.1
interface=wlan0
dhcp-range=10.0.0.10,10.0.0.250,12h
no-resolv
log-queries

文件:/etc/dhcp/dhclient.conf

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname(); 
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,
        dhcp6.name-servers, dhcp6.domain-search,
        netbios-name-servers, netbios-scope, interface-mtu,
        rfc3442-classless-static-routes, ntp-servers;

文件:/etc/dhcpcd.conf

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

简单的解决方案,插入 HDMI 显示器和键盘并使用桌面网络 GUI 设置 Wifi(单击右上角的 WiFi 徽标)。

对于 Raspberry Pis(无论 Pi 0 到 Pi3,它们都是相同的),一个更冗长的选择是使用数百篇文章中的一篇。 快速 Google 搜索发现:https://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/setting-up-wifi-with-occidentalis

甚至(对于注意力持续时间较短的人):https://www.google.co.uk/search?q=raspberry+pi+configure+wifi&oq=raspberry+pi+configure+wifi&aqs=chrome..69i57j0l5.6863j0j7&sourceid=chrome&ie=UTF-8#q=raspberry+pi+configure+wifi&tbm=vid

祝你好运,不要害怕 Google 这些事情。

我已阅读博客并按照所有步骤成功实现了服务器。
您可能配置错误。我的赌注是 /etc/network/interfaces 文件或 /etc/dnsmasq.conf.
另外,检查您是否没有打开另一个 dhcp 服务器。也许内部 /etc/dhcp/dhcpd.conf 正在覆盖您的 ip 池。
Post所有文件的相关部分,看看有没有错误。

如果您 运行 ifconfig -a,您的 wlan0 接口是否有正确的 IP 地址 10.0.0.1?我的没有。在 /etc/network/interfaces 我添加了行

允许热插拔 wlan0

在 iface wlan0 行上方。这似乎解决了地址问题和同样的错误,"no address range available for DHCP request via wlan0" 你得到了。

您的网页有问题,因为 nginx 在 /var/www/html 中查找页面。 使用此行 ...

sudo echo "<h1>hello<h1>" > /var/www/html/index.html

注意删除“!”和不同的目标文件夹

我遇到了与你完全相同的问题,这让我的大部分工作正常。