|
@@ -122,7 +122,7 @@ function restore_remote_vpn {
|
122
|
122
|
|
123
|
123
|
function remove_vpn {
|
124
|
124
|
systemctl stop openvpn
|
125
|
|
- apt-get -yq remove --purge fastd openvpn easy-rsa
|
|
125
|
+ apt-get -yq remove --purge fastd openvpn easy-rsa stunnel4
|
126
|
126
|
if [ -d /etc/openvpn ]; then
|
127
|
127
|
rm -rf /etc/openvpn
|
128
|
128
|
fi
|
|
@@ -206,6 +206,9 @@ function create_user_vpn_key {
|
206
|
206
|
sed -i 's|key client.key|;key client.key|g' $user_vpn_cert_file
|
207
|
207
|
sed -i 's|tls-auth ta.key|;tls-auth ta.key|g' $user_vpn_cert_file
|
208
|
208
|
|
|
209
|
+ sed -i 's|;proto tcp|proto tcp|g' $user_vpn_cert_file
|
|
210
|
+ sed -i 's|proto udp|;proto udp|g' $user_vpn_cert_file
|
|
211
|
+
|
209
|
212
|
echo '<ca>' >> $user_vpn_cert_file
|
210
|
213
|
cat /etc/openvpn/ca.crt >> $user_vpn_cert_file
|
211
|
214
|
echo '</ca>' >> $user_vpn_cert_file
|
|
@@ -239,7 +242,7 @@ function remove_user_vpn {
|
239
|
242
|
}
|
240
|
243
|
|
241
|
244
|
function install_vpn {
|
242
|
|
- apt-get -yq install fastd openvpn easy-rsa
|
|
245
|
+ apt-get -yq install fastd openvpn easy-rsa stunnel4
|
243
|
246
|
|
244
|
247
|
if [ ! -f /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz ]; then
|
245
|
248
|
echo $'Example openvpn server config not found'
|
|
@@ -257,6 +260,9 @@ function install_vpn {
|
257
|
260
|
sed -i 's|;group no.*|group vpn|g' /etc/openvpn/server.conf
|
258
|
261
|
sed -i 's|;max-clients.*|max-clients 2|g' /etc/openvpn/server.conf
|
259
|
262
|
|
|
263
|
+ sed -i 's|;proto tcp|proto tcp|g' /etc/openvpn/server.conf
|
|
264
|
+ sed -i 's|proto udp|;proto udp|g' /etc/openvpn/server.conf
|
|
265
|
+
|
260
|
266
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
261
|
267
|
sed -i 's|# net.ipv4.ip_forward|net.ipv4.ip_forward|g' /etc/sysctl.conf
|
262
|
268
|
sed -i 's|#net.ipv4.ip_forward|net.ipv4.ip_forward|g' /etc/sysctl.conf
|