AdGuardVPNCLI icon indicating copy to clipboard operation
AdGuardVPNCLI copied to clipboard

Auto-Connect and Auto-Launch

Open PavelParkhomenko opened this issue 1 year ago • 8 comments

Issue Details

Connecting to the server requires manually launching the interface after restarting the system and entering a command each time the interface is restarted

Proposed solution

Implement features that enable the interface to auto-launch at system startup and automatically connect to the server when the interface starts

Alternative solution

No response

PavelParkhomenko avatar Aug 12 '24 12:08 PavelParkhomenko

Another vote for this feature 🙏

mjeshurun avatar Oct 30 '24 08:10 mjeshurun

This feature is highly relevant, and I'm eagerly looking forward to its implementation 🙏

redlovv avatar Oct 30 '24 11:10 redlovv

Oohh yesaa, I would be all for it! All attempts to get the application to autostart failed for me. (Linux Mint Debian Edition 6)

Please implement this feature. Thank you very much!

Achim242 avatar Nov 11 '24 16:11 Achim242

I have found the following workaround, using the example of the server in the Netherlands (NL) (Everything with root rights)

Generate a systemd unit

`cat > /etc/systemd/system/adguardvpn.service << EOF [Unit] Description=AdGuardVPN cli After=network.target

[Service] User=root Type=oneshot RemainAfterExit=yes ExecStart=/usr/local/bin/adguardvpn-cli connect -l NL

[Install] WantedBy=multi-user.target EOF`

check: ls -l /ect/systemd/system/adguardvpn.service

reload systemctl daemon-reload

start systemctl start adguardvpn.service

status systemctl status adguardvpn.service

enable systemctl enable adguardvpn.service

Thats it. Now you just have to log in again. (if necessary) adguardvpn-cli login

have fun :)

Achim242 avatar Nov 12 '24 16:11 Achim242

could you please explain, why do you need to log in again at the end?

ReLoneR1 avatar Nov 24 '24 01:11 ReLoneR1

could you please explain, why do you need to log in again at the end?

The note is only optional, as the connection did not work after the systemd unit was created. The reason was that I was suddenly logged out of my Adguard account. If this is not the case, this step is of course not necessary.

Do my instructions work for you?

What I have noticed since this autostart, however, is that the status query adguardvpn-cli status gives the answer "VPN is disconnected", although I am still connected, as numerous web browser tests have shown.

Achim242 avatar Nov 24 '24 18:11 Achim242

I have found the following workaround, using the example of the server in the Netherlands (NL) (Everything with root rights)

Generate a systemd unit

`cat > /etc/systemd/system/adguardvpn.service << EOF [Unit] Description=AdGuardVPN cli After=network.target

[Service] User=root Type=oneshot RemainAfterExit=yes ExecStart=/usr/local/bin/adguardvpn-cli connect -l NL

[Install] WantedBy=multi-user.target EOF`

check: ls -l /ect/systemd/system/adguardvpn.service

reload systemctl daemon-reload

start systemctl start adguardvpn.service

status systemctl status adguardvpn.service

enable systemctl enable adguardvpn.service

Thats it. Now you just have to log in again. (if necessary) adguardvpn-cli login

have fun :)

Hi @Achim242 , and thank you for taking the time to explain your workaround.

Could your solution also be used if AdguardVPN-CLI is installed as a docker container?

Unfortunately, I'm not a programmer, so I don't know how to implement your workaround to my situation.

mjeshurun avatar Nov 24 '24 18:11 mjeshurun

I have done that with the service few month ago, but now I wait for Wireguard, so we don't need a custom client. Had too much problems (also the thing with "not connected" - think about a killswitch...) with the client and right now I use a different VPN for my Linux nodes. Hopefully they will push the Wireguard implementation forward!

xairoo avatar Nov 25 '24 11:11 xairoo