Problems setting up HostAPD on Pi 3 Jessie Lite

1.2k views Asked by At

I'm following this Adafruit tutorial with the end goal of setting up a portable Tor routed WiFi access point. I did this entire tutorial start to finish yesterday on the same Pi 3 running Raspbian Jessie, and it worked perfectly.

However, due to SD card size restrictions (I'm on a tight budget and I need to make quite a few) and the fact that I don't want a GUI, I decided to start again but with Raspbian Jessie Lite (using the last Jessie release before Stretch), and now I can't seem to get past the HostAPD setup when I'm following the tutorial line for line and using the same Pi 3!

THE PROBLEM: When I get to the "First Test" part of the tutorial and run HostAPD for the first time I should get an output something like this:

What the tutorial says I should see

But instead I get this:

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

The tutorial (and multiple other sources) says that if I'm using the built-in Wi-Fi module, I don't need to specify a driver for it (It worked yesterday without a driver specified too) but something is not working this time and the only thing I've changed is the OS from Jessie to Jessie Lite.

My laptop and other devices can see and connect to the network but there is no internet. Of course I can ping the Gateway IP but not the DNS 8.8.8.8.

My HostAPD config file is the same as the tutorial's and is as follows:

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

note: Password123 is not a password that I use and it will be changed!

My /etc/network/interface file is not quite the same as the tutorial but worked yesterday like this:

# 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

I realise that the this file says:

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

But it worked fine on the full version of Jessie (Latest release too) and if this is the cause of the problem I'm really not sure how to make this tutorial work with the /etc/dhcpd.conf file.

My /etc/sysctl.conf is set up as follows:

#
# /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

The bottom of this file seems to be missing 2 lines that are visible in the screenshot from the tutorial however I didn't add them yesterday because the tutorial doesn't even mention them (as I said, yesterday I managed to get the Pi working perfectly as a Tor Routed access point using exactly the same steps).

Screenshot from the tutorial:

Tutorial screenshot

0

There are 0 answers