support pivpnNET from setupVARs.conf

This commit is contained in:
DerDanilo 2021-03-15 18:33:21 +01:00
parent 805de5f77f
commit d3e009d171
3 changed files with 10 additions and 2 deletions

View file

@ -1063,7 +1063,10 @@ installPiVPN(){
if [ "$VPN" = "openvpn" ]; then
pivpnDEV="tun0"
pivpnNET="10.8.0.0"
# Allow custom NET via unattend setupVARs file. Use default if not provided.
if [ -z "$pivpnNET" ]; then
pivpnNET="10.8.0.0"
fi
vpnGw="${pivpnNET/.0.0/.0.1}"
askAboutCustomizing
@ -1085,7 +1088,10 @@ installPiVPN(){
# set the protocol here.
pivpnPROTO="udp"
pivpnDEV="wg0"
pivpnNET="10.6.0.0"
# Allow custom NET via unattend setupVARs file. Use default if not provided.
if [ -z "$pivpnNET" ]; then
pivpnNET="10.6.0.0"
fi
vpnGw="${pivpnNET/.0.0/.0.1}"
# Forward all traffic through PiVPN (i.e. full-tunnel), may be modified by
# the user after the installation.

View file

@ -4,6 +4,7 @@ IPv4gw=192.168.23.1
dhcpReserv=0
install_user=pi
VPN=openvpn
pivpnNET=10.8.0.0
subnetClass=24
pivpnPROTO=udp
pivpnPORT=1194

View file

@ -1,6 +1,7 @@
IPv4dev=eth0
install_user=pi
VPN=wireguard
pivpnNET=10.6.0.0
subnetClass=24
pivpnPORT=51820
pivpnDNS1=9.9.9.9