在Pi 3 Jessie Lite上设置HostAPD时出现问题

时间:2017-09-10 18:46:23

标签: raspberry-pi raspbian raspberry-pi3 adafruit hostapd

我正在关注此Adafruit tutorial,其最终目标是设置便携式Tor路由WiFi接入点。我昨天在同一个运行Raspbian Jessie的Pi 3上完成了整个教程的开始,并且它运行得很好。

然而,由于SD卡大小限制(我的预算紧张,我需要做很多)以及我不想要GUI的事实,我决定重新开始但是使用Raspbian Jessie Lite (使用Stretch之前的最后一个Jessie版本),现在当我按照教程行并使用相同的Pi 3时,我似乎无法通过HostAPD设置!

问题: 当我进入教程的“第一次测试”部分并第一次运行HostAPD时,我应该得到这样的输出:

What the tutorial says I should see

但我得到了这个:

user0@raspberrypi:~ $ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Failed to create interface mon.wlan0: -95 (Operation not supported)
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:41:64:5e and ssid "Extrea-Special-Wifi"
wlan0: interface state COUNTRY_UPDATE->ENABLED
wlan0: AP-ENABLED

教程(以及其他多个来源)说,如果我使用内置的Wi-Fi模块,我不需要为它指定驱动程序(它在昨天没有指定驱动程序的情况下工作)但是这次没有工作,我唯一改变的是从Jessie到Jessie Lite的操作系统。

我的笔记本电脑和其他设备可以查看并连接到网络,但没有互联网。当然我可以ping网关IP而不是DNS 8.8.8.8。

我的HostAPD配置文件与教程相同,如下所示:

interface=wlan0
#driver=rtl871xdrv
ssid=Extrea-Special-Wifi
country_code=GB
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Password123
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_group_rekey=86400
ieee80211n=1
wme_enabled=1

注意:Password123不是我使用的密码,它会被更改!

我的/ etc / network / interface文件与教程不完全相同,但昨天就像这样工作:

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0

我意识到这个文件说:

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

但它在Jessie的完整版本上运行良好(最新版本) 如果这是问题的原因,我真的不确定如何使用/etc/dhcpd.conf文件使用本教程。

我的/etc/sysctl.conf设置如下:

#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
net.ipv4.ip_forward=1

这个文件的底部似乎缺少2条在教程截图中可见的行但是我昨天没有添加它们因为教程甚至没有提到它们(正如我所说,昨天我设法得到了Pi使用完全相同的步骤完美地作为Tor Routed接入点工作。)

教程的屏幕截图:

Tutorial screenshot

0 个答案:

没有答案