Hi, this is my first post so please go easy. By profession I'm an Azure engineer, but Linux really isn't my strong point - just started off.
My question is as per subject, but the reason is that I've turned my raspberry pi into a VPN router. This had gone well as a first project. Connects on startup, routes all Ethernet traffic though the VPN interface nicely. Only issue is, if I get a dropout on my main internet router, openvpn by default, doesn't reconnect. Is there a way to enforce this, or do I need to have a background service running that will say ping 8.8.8.8 and on packet loss, restart the openvpn service?
Thanks in advance for any help given.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Restart service on internet connectivity loss
Re: Restart service on internet connectivity loss
we are talking about systemd services?
first of all, you should look at the existing service:(assuming it is called openvpn)
systemd uses targets, one of them is called network.target.
i'm not sure if it will enter a failed state that you can query with another systemd setting...
suggested reading:
https://wiki.debian.org/systemd
https://wiki.archlinux.org/index.php/Systemd
first of all, you should look at the existing service:
Code: Select all
journalctl -b -u openvpn
systemctl status openvpn
nano /path/to/openvpn.service
etc.
systemd uses targets, one of them is called network.target.
i'm not sure if it will enter a failed state that you can query with another systemd setting...
suggested reading:
https://wiki.debian.org/systemd
https://wiki.archlinux.org/index.php/Systemd