How to setup wireguard

jag5cof

Dabbler
Joined
Apr 7, 2017
Messages
18
Is there a thread on how to setup Wireguard on Truenas Scales? It is simple on the raspberry pi.
If I miss the thread I'm sorry.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
wg is installed on the SCALE host system.

Depending on how you want your network setup to look, there are many different things you could do with it.

As it's something done at the CLI, you would probably need to get your commands worked out to start the VPN, then run those as a init/startupscript or cron task.

I imagine there's no specific magic to making it work on SCALE/Debian, so just following other setup instructions might be fine, but do consider things like bridging or LAGG and make sure you're doing that the right way around.
 

jag5cof

Dabbler
Joined
Apr 7, 2017
Messages
18
Thank you for your response. As I mention in my original statement. I have a wireguard running on my raspberry pi, I use pivpn to get it set up.
Do you know if this would work on Truenas scales?
 

SnoppyFloppy

Explorer
Joined
Jun 17, 2021
Messages
77
I wouldn't recommend running pivpn on your scale system as it runs a lot of automated configuration that does not assume that you are on a scale system - e.g. setting up iptable rules.
It should not be too dificult to set it up nalually though.

Just remember to create a new interface - like wg1 - as scale will overwrite wg0 conf on startup - I think it wg0 is reserved for truecomander
 

jag5cof

Dabbler
Joined
Apr 7, 2017
Messages
18
I wouldn't recommend running pivpn on your scale system as it runs a lot of automated configuration that does not assume that you are on a scale system - e.g. setting up iptable rules.
It should not be too dificult to set it up nalually though.

Just remember to create a new interface - like wg1 - as scale will overwrite wg0 conf on startup - I think it wg0 is reserved for truecomander
Do you have a manul process for installing wireguard on truenas scales. Thanks
 

SnoppyFloppy

Explorer
Joined
Jun 17, 2021
Messages
77
Do you have a manul process for installing wireguard on truenas scales. Thanks
Well I guess that you could use one of the countless guides world wild web. The tricky part is that in order to make it persistent across scale updates you would have to have a script that is run by a cron job as all user-made changes to the system (like new wg interfaces) is wiped on update.

I've heard of people making a bash script that runs as a cron job every fifth minute or so and 1) checks if wg1 is up and if not 2) tries to bring it up, if that fails 3) copy a pre-made wg1.conf from another folder and brings it up using "wg-quick up wg1". There might be more too it like setting up iptables, I dunno.

Unfortunately I'm not proficient enough to make such script myself though I would like to have one. :smile:
 
Last edited:

SnoppyFloppy

Explorer
Joined
Jun 17, 2021
Messages
77
@jag5cof if you still need to setup wireguard on your TN Scale system then look at this post from @LMCDZ .


It's very easy indeed, you just create the wgXX.conf somewhere on your storage system and then create a cronjob (settings --> advancet) and follow the guide from the linked post (#11). Then the interface will be brought up automatically if scale restarts and after updates.

As I said earlier, there is thousands of guides on the internet on how to create a WG config manually.
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
There's also the option of using our VPN addon with out Apps to have them push traffic through the VPN service :)
 

CoolWolf

Dabbler
Joined
Mar 2, 2023
Messages
10
@jag5cof if you still need to setup wireguard on your TN Scale system then look at this post from @LMCDZ .


It's very easy indeed, you just create the wgXX.conf somewhere on your storage system and then create a cronjob (settings --> advancet) and follow the guide from the linked post (#11). Then the interface will be brought up automatically if scale restarts and after updates.

As I said earlier, there is thousands of guides on the internet on how to create a WG config manually.
That saved my day! :cool:
 
Top