https://github.com/robiningelbrecht/raspberry-pi
Repository that holds scripts to setup my Raspberry Pi
https://github.com/robiningelbrecht/raspberry-pi
Last synced: 12 months ago
JSON representation
Repository that holds scripts to setup my Raspberry Pi
- Host: GitHub
- URL: https://github.com/robiningelbrecht/raspberry-pi
- Owner: robiningelbrecht
- License: mit
- Created: 2024-10-16T13:18:40.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-24T15:41:54.000Z (over 1 year ago)
- Last Synced: 2024-11-24T16:33:56.223Z (over 1 year ago)
- Language: SCSS
- Size: 676 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Configure PI as an Access Point over VPN
## Prerequisites
* Make sure your system is up to date and upgraded
* Install git to pull and update this script
```bash
> sudo apt-get update
> sudo apt-get full-upgrade
> sudo reboot
> sudo apt install firmware-brcm80211 # installs WiFi chip update, if any
> sudo apt install git-all
> git clone git@github.com:robiningelbrecht/raspberry-pi.git .
```
* Set your timezone/location
```bash
> sudo raspi-config
# then 'Localisation Options' - then set your locale, timezone and WLAN country.
```
* Create a file `config.sh` and make sure it defines following variables
```bash
#!/bin/bash
SSID=""
WIFI_PASSWORD=""
WIFI_CHANNEL=""
WIREGUARD_CLIENT_NAME=""
```
* Navigate to https://account.proton.me/u/0/vpn/WireGuard and generate a WireGuard config
* Copy the contents in a new file `wireguard.conf`
* Make sure `hotspot.sh` is executable, run following command if it's not
```bash
> chmod +x hotspot.sh
```
## Configure an access point
```bash
> sudo ./hotspot.sh setup
```
At this point the hotspot should be available for devices to connect to.
## Install PiVPN
* Run `ifconfig` on your Raspberry Pi and copy the MAC address from `eth0` interface
* Log in into Mobile Vikings and add a new DHCP-RESERVERING.
* Use the MAC address you copied
* Set the IP address to `192.168.129.10`
* Reboot your Raspberry Pi
* Run `ifconfig` again and verify the router issues the configured IP address to your Pi
* To install PiVPN, run
```bash
> curl -L https://install.pivpn.io | bash
```
* If prompted to choose an interface, select `eth0`
## Configure PiVPN
* After install, run
```bash
> sudo ./hotspot.sh enable_vpn
```
* if you get an error saying something about `openresolv` , run `sudo apt install openresolv`
* Run `sudo wg` to check status
## Force DHCP to renew IP address
```bash
> sudo dhclient -v -r eth0
> sudo dhclient -v eth0
```
You light need to restart your router to flush DNS cache
## Maintaining Your System
```bash
> sudo crontab -e
> 0 3 * * * apt-get autoremove -y && apt-get autoclean -y
```