forked from pivpn/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added small guide with info about running pivpn unattended as user data during cloud instance boot
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
title: Cloud instance user data | ||
summary: How to run the script on cloud instance user data | ||
Authors: 4s3ti | ||
|
||
# Cloud instance user data | ||
|
||
PiVPN can be used to install OpenVPN or Wireguard completely unattended during a cloud instance boot (example AWS) | ||
|
||
!!! Note | ||
This info is focused at more advanced users that wish to have their own VPN in the cloud or spin up VPN servers on demand with PiVPN. | ||
|
||
* You should be comfortable reading bash and understanding what the provided scripts below are doing. | ||
* You should know what a cloud instance is | ||
* You should know what user data is | ||
|
||
|
||
|
||
Configuration file examples can be found here [here](https://github.com/pivpn/pivpn/tree/master/examples) | ||
|
||
You can use the following script as an example and adjust the values to suit your needs | ||
|
||
``` | ||
#!/bin/bash | ||
# Create options file | ||
cat << EOF > /tmp/options.conf | ||
USING_UFW=0 | ||
IPv4dev=ens5 | ||
install_user=admin | ||
install_home=/home/admin | ||
VPN=openvpn | ||
pivpnPROTO=udp | ||
pivpnPORT=1194 | ||
pivpnDNS1=8.8.8.8 | ||
pivpnDNS2=8.8.4.4 | ||
TWO_POINT_FOUR=1 | ||
pivpnENCRYPT=256 | ||
USE_PREDEFINED_DH_PARAM=1 | ||
INPUT_CHAIN_EDITED=0 | ||
FORWARD_CHAIN_EDITED=0 | ||
pivpnDEV=tun0 | ||
pivpnNET=10.8.0.0 | ||
subnetClass=24 | ||
UNATTUPG=1 | ||
EOF | ||
# Install git and clone pivpn repo | ||
apt update && apt install -y git | ||
git clone https://github.com/pivpn/pivpn /tmp/pivpn | ||
# Install PiVPN from options.conf | ||
cd /tmp/ || exit | ||
bash pivpn/auto_install/install.sh --unattended /tmp/options.conf | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters