The officially official Devuan Forum!

You are not logged in.

#1 2024-01-20 19:49:43

DavidRLTG
Member
Registered: 2024-01-20
Posts: 20  
Website

How the heck do I get wireguard to be always on?

I know, I know, I'm sorry, I am unsure if this the right place to ask this question on but
Really! I couldn't find much help anywhere. I'm on Devuan OpenRC, using the wgcf (wireguard cloudflare) config.
Is there some way to get the config to load every time I boot up (something similar to the command below):

wg-quick up wgcf-profile

It would really help a lot. Thanks lads, I appreciate any help given.

Last edited by DavidRLTG (2024-01-20 19:50:22)


Both depressed, And obsessed with tech!
That's me smile
-DavidRLTG

Offline

#2 2024-01-22 12:48:28

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 172  

Re: How the heck do I get wireguard to be always on?

Does openrc use sysvinit scripts?  I am not too familiar with openrc/runit/s6, yet, so if I am totally incorrect, please forgive me.

I used this info to create a sysvinit start script using my own wireguard profile config.  I hope it helps.

https://www.procustodibus.com/blog/2021 … it-script/

Offline

#3 2024-01-22 12:49:22

DavidRLTG
Member
Registered: 2024-01-20
Posts: 20  
Website

Re: How the heck do I get wireguard to be always on?

Thank you friend, I'll try it out later!


Both depressed, And obsessed with tech!
That's me smile
-DavidRLTG

Offline

#4 2024-01-22 17:23:48

DavidRLTG
Member
Registered: 2024-01-20
Posts: 20  
Website

Re: How the heck do I get wireguard to be always on?

Hey! I don't think the script works on OpenRC sad
Besides, sorry for being a newbie, But I'm unsure where to put it or how to
add my own config onto it. Any tips?


Both depressed, And obsessed with tech!
That's me smile
-DavidRLTG

Offline

#5 2024-01-22 22:07:25

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 527  

Re: How the heck do I get wireguard to be always on?

please see this post... for a conversion script.

https://dev1galaxy.org/viewtopic.php?id=4865

beware of the start and stop levels after converting to suit your situation.

I haven't tested on wireguard... but I have had success with others.

all the best.


pic from 1993, new guitar day.

Offline

#6 2024-01-22 22:09:48

DavidRLTG
Member
Registered: 2024-01-20
Posts: 20  
Website

Re: How the heck do I get wireguard to be always on?

Crap. How do I use it?
Sorry, I'm easily confused, Not really the most experienced linux user here.
Either way, thanks a bunch!


Both depressed, And obsessed with tech!
That's me smile
-DavidRLTG

Offline

#7 2024-01-22 22:13:18

rolfie
Member
Registered: 2017-11-25
Posts: 1,011  

Re: How the heck do I get wireguard to be always on?

openrc is nothing but some sort of overhead on sysvinit. Give those scripts a try, I guess they will work alright.

Offline

#8 2024-01-22 22:19:30

DavidRLTG
Member
Registered: 2024-01-20
Posts: 20  
Website

Re: How the heck do I get wireguard to be always on?

No idea how to add my config to the script. I know, I'm dumb, i just don't see where.
Would you guys be willing to help a complete newbie? 😂
I gotta somehow add wg-quick up wgcf-profile to it. Which lines should I edlt? And where?
No idea how to get stuff like this working, I used to use warp-cli.

Last edited by DavidRLTG (2024-01-22 22:19:44)


Both depressed, And obsessed with tech!
That's me smile
-DavidRLTG

Offline

#9 2024-01-22 22:58:06

nixer
Member
From: North Carolina, USA
Registered: 2016-11-30
Posts: 172  

Re: How the heck do I get wireguard to be always on?

From the link above,

Save the above sysvinit script as /etc/init.d/wg0

or "<your-name>" for the script.  Make it executable.

Change this line in the script, or keep it as is:

interface=wg0

- or -

interface=<your-name>

Follow the instructions on adding the symlinks.  Then try to use the usual service commands to start/stop/status:
service <your-name> start/stop/status

Put your wireguard profile file in /etc/wireguard .  Give it your preferred name, maybe "wg0" or <your-name>.  The name you give it should be the same through the sysvinit script, and the profile name, I think.

Offline

#10 2024-01-22 22:59:38

DavidRLTG
Member
Registered: 2024-01-20
Posts: 20  
Website

Re: How the heck do I get wireguard to be always on?

That helps a lot.
Thank you, friend.
I'll try it tomorrow and leave an update here
smile


Both depressed, And obsessed with tech!
That's me smile
-DavidRLTG

Offline

Board footer