[GUIDE] VPN always active
Hi, I successfully configured server and client on UT with rpi, pihole and pivpn on it.
When cellular data connection is poor and it's being interrupted, vpn disconnects and I have to click its switch so many times.
When cellular data connection is poor and it's being interrupted, vpn disconnects and I have to click its switch so many times...
What is the
nmclicommand to enable cellular data connection?
based on this askubuntu thread
open terminal on your phone or use ssh as you wish
(I replaced UUID with "MY_ID" and my vpn name with "MY_VPN_NAME")
phablet@ubuntu-phablet:~$ nmcli c show --active | grep vpn MY_VPN_NAME MY_ID vpn ril_0
phablet@ubuntu-phablet:~$ nmcli c edit MY_ID ===| nmcli interactive connection editor |=== Editing existing 'vpn' connection: 'MY_ID' Type 'help' or '?' for available commands. Type 'describe [<setting>.<prop>]' for detailed property description. You may edit the following settings: connection, vpn, ipv4, ipv6
nmcli> print connection.autoconnect connection.autoconnect: no
nmcli> set connection.autoconnect yes
nmcli> save persistent Saving the connection with 'autoconnect=yes'. That might result in an immediate activation of the connection. Do you still want to save? (yes/no) [yes] yes Connection 'MY_VPN_NAME' (MY_ID) successfully updated. nmcli>
(based on this askubuntu thread)
nmcli> print vpn.persistent vpn.persistent: no
nmcli> set vpn.persistent yes
nmcli> save persistent Connection 'MY_VPN_NAME' (MY_ID) successfully updated.
Save one of needed script in home direction and make it executable, replace only: MY_ID and MY_VPN_NAME
replace "2s" with any value if you want the script to run at different intervals
You can also add it to autostart.
based on this
To run any of this script you have to use command
.is not exactly equal to
Scripts to control always on vpn moved to github:
First Post changelog
- 2020.10.26 - IMPORTANT! - moved scripts with explanation to github
- 2020.08.20 - added one script, named others, updated all, since today when i edit script
0.0.0numbers will change
- 2020.08.19 - changed script which may be the solution if you run it with autostart
- 2020.08.18 - added "my tests" header, added tag "openvpn"
- 2020.08.10 - issue creation