Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im using openvpn enabled as a service. It works well, but once I get assigned a new IP adress or lose the connection, I cant access to the internet any more. Then I have to systemctl restart openvpn@ipredator.conf manually. How can I fix that so I dont have to login as root each time and restart the service manually?

[root@arch paul]# cat /etc/openvpn/ipredator.conf 
dev tun0
proto udp
remote pw.openvpn.ipredator.se 1194
resolv-retry infinite

auth-user-pass /etc/openvpn/ipredator.auth
auth-retry nointeract

ca [inline]

tls-auth [inline]
ns-cert-type server

keepalive 10 30
cipher AES-256-CBC
tun-mtu 1500
verb 3


-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
share|improve this question
This should already be happening with keepalive 10 30, which will expand to ping 10 and ping-restart 30 on your client and try to reconnect after 30 seconds when the connection is lost. But it might get overridden by a directive pushed from the server. Please also post the server config or the log output from the client to see if any directives are pushed. Look for a line like this: PUSH: Received control message: 'PUSH_REPLY,ping 10,ping-restart 60' – rda Apr 26 at 14:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.