A one-stop-shop to set up WireGuard, Pi-Hole and Unbound for all versions of Raspberry Pi (armhf included!)
NOTE: This is still a work in progress and is by no means stable. Use/modify at your own discretion!
- IMPORTANT: Temporarily set up 'autologin' using the raspi-config utility (you can change this back immediately afterwards)
In the GUI, navigate to the following setting and enable autologin:
--> 'Boot Options' --> 'B1: Desktop / CLI' --> 'B2 Console Autologin' --> 'OK' --> Close raspi-config
- As mentioned in the script, several commands require administrative priviledges, so you can choose to run the script with "sudo" before if you don't want to enter your password each time a command runs. The script will alternatively ask to run 'sudo --validate' which will temporarily disable (for 15 minutes) the need for a password.
- Install git so you can clone this repo
sudo apt-get install git -y
- Clone this repo and move into the newly made directory
cd $HOME && git clone https://github.com/ShaneCaler/EasyAsPiInstaller.git && cd EasyAsPiInstaller && sudo chmod +x EasyAsPi.sh
- Run the installer! Type the following below and just follow all of the prompts. There will be a lot, but that's just because I wanted to offer the ability to customize your setup. If you have any issues, refer back to here in the troubleshooting section or open up an issue and I'll try to help out!
sudo ./EasyAsPi.sh
WireGuard Specific
Adrian Mihalko @ https://github.com/adrianmihalko/raspberrypiwireguard
Angristan @ https://github.com/angristan/wireguard-install/blob/master/wireguard-install.sh
Angristan @ https://angristan.xyz/how-to-setup-vpn-server-wireguard-nat-ipv6/
Arch Linux @ https://wiki.archlinux.org/index.php/WireGuard
Emanuel Duss @ https://emanuelduss.ch/2018/09/wireguard-vpn-road-warrior-setup/
Official WireGuard docs @ https://www.wireguard.com/quickstart/
WireGuard & Pi-hole (& some Unbound)
Aveek Dasmalakar @ https://medium.com/@aveek/setting-up-pihole-wireguard-vpn-server-and-client-ubuntu-server-fc88f3f38a0a
Daluf @ https://github.com/pirate/wireguard-docs/blob/master/README.md#config-reference
Harry Pnyce @ https://github.com/harrypnyce/raspbian10-buster/blob/master/README.md
i4ApvDqgDV @ https://gist.github.com/i4ApvDqgDV/e2e566385cae3081cc9850bdd3ab166f
Official Pi-hole docs @ https://docs.pi-hole.net/guides/unbound/
Pi-hole Discourse @ https://discourse.pi-hole.net/t/how-do-i-configure-my-devices-to-use-pi-hole-as-their-dns-server/245
u/vaporisharc92 @ https://www.reddit.com/r/pihole/comments/bnihyz/guide_how_to_install_wireguard_on_a_raspberry_pi/
Transitioning from iptables to nftables
Stamus Networks @ https://home.regit.org/netfilter-en/nftables-quick-howto/
Official nftalbes docs @ https://wiki.nftables.org/wiki-nftables/index.php/Moving_from_iptables_to_nftables
Official nftable docs @ https://wiki.nftables.org/wiki-nftables/index.php/Quick_reference-nftables_in_10_minutes
Gentoo Linux authors @ https://wiki.gentoo.org/wiki/Nftables/Examples#Typical_workstation_.28separate_IPv4_and_IPv6.29
TLDP authors @ http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/ch18s05.html
Bash Commands
Methods of running a script on boot
- Raspberry Pi Forums @ https://www.raspberrypi.org/forums/viewtopic.php?t=202561
- StackExchange question @ https://unix.stackexchange.com/questions/145294/how-to-continue-a-script-after-it-reboots-the-machine
- Ubuntu Forums @ https://ubuntuforums.org/showthread.php?t=1325843
Methods of setting the current working directory
- StackOverflow question @ https://stackoverflow.com/questions/3349105/how-to-set-current-working-directory-to-the-directory-of-the-script
- StackOverflow question @ https://stackoverflow.com/questions/192292/how-best-to-include-other-scripts/12694189#12694189
- StackOverflow question @ https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself
Methods of extracting networking/system information
- StackOverflow question @ https://stackoverflow.com/questions/21336126/linux-bash-script-to-extract-ip-address
- StackExchange question @ https://unix.stackexchange.com/questions/412516/create-an-array-with-all-network-interfaces-in-bash
- AskUbuntu question @ https://askubuntu.com/questions/15853/how-can-a-script-check-if-its-being-run-as-root
- Raspberry Pi Forums @ https://www.raspberrypi.org/forums/viewtopic.php?t=34678