summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rwxr-xr-xpublic/fs/etc/openvpn/hostvpn-conf.sh7
-rw-r--r--public/fs/etc/openvpn/hostvpn.conf.in6
2 files changed, 10 insertions, 3 deletions
diff --git a/public/fs/etc/openvpn/hostvpn-conf.sh b/public/fs/etc/openvpn/hostvpn-conf.sh
index a438a54..24cb390 100755
--- a/public/fs/etc/openvpn/hostvpn-conf.sh
+++ b/public/fs/etc/openvpn/hostvpn-conf.sh
@@ -10,10 +10,17 @@ cfg_srcdir=$(cd -- "${cfg_script%/*}/" ; pwd -P)
source /root/config/private/config/server.ports
source /root/config/private/config/hostinfo/${sitezone}
+if [ ${vpn_route_all} = 'yes' ]; then
+ vpn_route_all_subst='s/^@vpn_route_all@ //g'
+else
+ vpn_route_all_subst='/^@vpn_route_all@ /d'
+fi
+
sed -e 's/@vpn_port@/'${vpn_port}'/g' \
-e 's/@hostname@/'${hostname}'/g' \
-e 's/@vpn_net4@/'${vpn_net4}'/g' \
-e 's/@vpn_ipv4@/'${vpn_ipv4}'/g' \
-e 's/@host_ipv4@/'${host_ipv4}'/g' \
-e 's/@host_ipv6@/'${host_ipv6}'/g' \
+ -e "${vpn_route_all_subst}" \
"${cfg_srcdir}/hostvpn.conf.in"
diff --git a/public/fs/etc/openvpn/hostvpn.conf.in b/public/fs/etc/openvpn/hostvpn.conf.in
index 59f7684..fb85982 100644
--- a/public/fs/etc/openvpn/hostvpn.conf.in
+++ b/public/fs/etc/openvpn/hostvpn.conf.in
@@ -23,9 +23,9 @@ push "route-ipv6 2000::/3"
push "route-ipv6 host_ipv6::/64"
push "route 192.168.0.0 255.255.255.0"
-push "block-outside-dns"
-push "redirect-gateway def1"
-push "dhcp-option DNS @vpn_ipv4@"
+@vpn_route_all@ push "block-outside-dns"
+@vpn_route_all@ push "redirect-gateway def1"
+@vpn_route_all@ push "dhcp-option DNS @vpn_ipv4@"
duplicate-cn
client-to-client