-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwg-vpc.env.sh
30 lines (26 loc) · 1003 Bytes
/
wg-vpc.env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# general
endpoint="ddns.example.com"
interface="wg1"
interface_ipcidr_prefix="10.0.20"
server_port="51820"
server_IP="${interface_ipcidr_prefix}.1"
vpc_site_ipcidr="10.255.0.0/24"
peer_allowed_ips="${interface_ipcidr_prefix}.0/24, ${vpc_site_ipcidr}"
# The IP address to start from
peer_IP="2"
# https://cloud.google.com/vpc/docs/mtu
# https://gist.github.com/nitred/f16850ca48c48c79bf422e90ee5b9d95
peer_mtu=1380
# Modify `usernames` with more or less usernames to create any number of peers
#! Linux interface name should no longer than 15 characters
usernames="alpha bravo charl delta"
# eval "peer_site_ipcidr=\${${username}_site_ipcidr}"
# https://www.shellcheck.net/wiki/SC2034
export alpha_site_ipcidr="10.255.2.0/24"
export bravo_site_ipcidr="10.255.3.0/24"
export charlie_site_ipcidr="10.255.4.0/24"
export delta_site_ipcidr="10.255.5.0/24"
# Use your device prefix to meet your need
path_prefix="${interface}"
config_dir="${self%/*}/config/${path_prefix}"
peers_dir="${config_dir}/peers"