A
A
Andrey2015-07-25 17:46:23
openvpn
Andrey, 2015-07-25 17:46:23

Is it possible to set up a local network between OpenVPN clients?

Hello!
Is it possible to set up a LAN between OpenVPN clients?
There are 5 vpn clients on Windows and you need to be able to exchange files between them.
client1: 10.10.10.5
client2: 10.10.10.9
client3: 10.10.10.13
client4: 10.10.10.17
client5: 10.10.10.21
Config on the server under Ubuntu 14.04

# cat /etc/openvpn/server.conf 
port 1194
proto tcp
dev tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key # This file should be kept secret
dh /etc/openvpn/keys/dh2048.pem
client-config-dir /etc/openvpn/ccd
server 10.10.10.0 255.255.255.0
client-to-client
keepalive 10 60
auth SHA1
cipher BF-CBC # Blowfish (default)
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log /var/log/openvpn.log
verb 3
mute 20

And yet, who can come across. Windows 8.1 on a laptop made automatic connection on reboot through the OpenVPN service. But when I close the lid and open it, the OpenVPN service is running, but there is no VPN connection anymore. When the service is restarted, everything works again. Is it possible to fix this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tutunak, 2015-07-26
@tutunak

In case OpenVPN doesn't restart when resuming from sleep, resulting in a broken connection:
/usr/lib/systemd/system-sleep/vpn.sh
#!/bin/sh
if [ "$1" == "pre" ]
then
killall openvpn
fi
chmod a+x /usr/lib/systemd/system-sleep/vpn.sh
Add Restart=always to /usr/lib/systemd/system/[email protected]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question