I followed these access point instructions (lines of commands and file edits) tutorial, and now whenever I use wget or pip, connection errors are thrown.
These were the instructions I followed:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install hostapd
sudo apt-get install dnsmasq
sudo systemctl stop hostapd
sudo systemctl stop dnsmasq
I make an edit to sudo nano /etc/dhcpcd.conf
Towards the end of the file I add these lines
interface wlan0
static ip_address=<pi's ip address>/24
denyinterfaces eth0
denyinterfaces wlan0
I configure the DHCP server
First I make a copy:
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
sudo nano /etc/dnsmasq.conf
then I make an edit:
interface=wlan0
dhcp-range=192.168.0.11,192.168.0.30,255.255.255.0,24h
Configure the access point software:
sudo nano /etc/hostapd/hostapd.conf
interface=wlan0
bridge=br0
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ssid=myNETWORK
wpa_passphrase=myPASSWORD
Show the locatin of the configuration file
sudo nano /etc/default/hostapd
Uncomment this line:
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Setup port forwarding:
sudo nano /etc/sysctl.conf
Uncomment this line:
net.ipv4.ip_forward=1
Add a new iptables rule
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Save the rule:
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
Load the rule on boot:
iptables-restore < /etc/iptables.ipv4.nat
Enable internet connection (build a bridge):
sudo apt-get install bridge-utils
sudo brctl addbr br0
sudo brctl addif br0 eth0
Edit the interfaces file:
sudo nano /etc/network/interfaces
auto br0
iface br0 inet manual
bridge_ports eth0 wlan0
So now whenever I try and install any python modules or download anything, connection errors are generated. This is an example:
connection broken by 'NewConnectionError('urllib3.connection.VerifiedHTTPSConnection...')
I also added nameserver 8.8.8.8
to /etc/resolv.conf
. That did not solve my problem.
I also tried turning off hostapd
and dnsmasq
. Nothing changes.
Edit: Removed link to tutorial and added a list of instructions that I followed.
Edit 2: It should also be noted that this access point does work, the raspberry pi zero that connects to this access point does in fact have an internet connection and I can ssh into it from a different computer.