Private Network with a Raspberry Pi 0 W 2

R1CH4RD5
2 min readJan 29, 2022

In this small article we will briefly create a private network, or Access Point, using a Raspberry Pi 0 W 2 where we can use it in a vast majority of projects.

Having a Raspberry Pi 0 W 2 fully configured and ready to go, open a terminal and execute the following command to clone a script that will automate and setup a Access Point and WiFi Client/Station network on the single WiFi chip of Raspberry Pi:

git clone https://github.com/idev1/rpihotspot.git

Navigate to the script directory with:

cd rpihotspot/

Then execute the following to give the script permission to be executable:

sudo chmod +x setup-network.sh

Before proceeding to the execution of the full command that will create the new access point, we need to consider some valid points like:

  • --ap-ssid will define the SSID/Network Name of the new Access Point;
  • --ap-password will define the password for the new Access Point;
  • --ap-country-code will be the country code as PT for Portugal;
  • --ap-ip-address is the IP address for the Access Point device where we can use the 192.168.0.1 or 10.0.0.1. Be aware that the IP given to any of the access point clients will be represented in the same type of address that we choose.

Now, use the next command, with the necessary changes, to create the Access Point on the Raspberry Pi 0 W 2:

sudo ./setup-network.sh --install --ap-ssid="[ACCESS_POINT_NAME]" --ap-password="[ACCESS_POINT_PASSWORD]" --ap-password-encrypt 
--ap-country-code="PT" --ap-ip-address="10.0.0.1" --wifi-interface="wlan0"

After everything completed, reboot the Raspberry Pi safely and then, on a terminal, execute the following command to see the new Access Point information, where in this case, in the wlan0 interface.

iwconfig

Using a smartphone or computer, check for the new Access Point in the available WIFI Networks.

Hope you liked this small article, best regards, Ricardo Costa (Richards).

--

--