0

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.

6
  • We cannot follow and "repair"all tutorials out there on the web to create an access point. Start again with a fresh flashed Raspberry Pi OS Lite based on Buster and follow the official tutorials Wireless connectivity. If you get problems then, please ask again. You may also have a look at Setting up a Raspberry Pi as an access point - the easy way and Access point as WiFi router/repeater, optional with bridge. – Ingo Dec 4 '20 at 12:29
  • Please don't just state you followed a tutorial: include commands needed to reproduce the error, the exact error message and the expected behaviour, if it cannot be trivially deduced from the commands. – Dmitry Grigoryev Dec 4 '20 at 15:54
  • Post fixed. I removed the link to the tutorial and added the instructions. – LaravelSucks Dec 4 '20 at 20:30
  • Also, recommending a clean install of an operating system is not an ideal solution. – LaravelSucks Dec 4 '20 at 20:37
  • With that said, I will most likely need to do that. – LaravelSucks Dec 4 '20 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.