Wireguard don't work

Rosin0416

Patron
Joined
Apr 11, 2016
Messages
214
Hello to all,

I need help to set up wireguard to access my files from outside. I followed the instructions in the official doc here: https://www.truenas.com/docs/core/coretutorials/network/wireguard/
I created the configuration file /root/wg0.conf, here it is :

On the nas side
[Interface]
PrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Address = 100.100.100.1
ListenPort = 50000

[Peer]
PublicKey = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
AllowedIPs = 100.100.100.2


Device (pc) side
[Interface]
PrivateKey = zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Address = 100.100.100.2

[Peer]
PublicKey = tttttttttttttttttttttttttttttttttttttttttttttttttttttttt
AllowedIPs = 100.100.100.1
Endpoint = 104.45.48.75:50000


As said in the documentation, I then restarted the server, then entered the ifconfig wg0 command, it returned :
root@truenas[~]# ifconfig wg0
ifconfig: interface wg0 does not exist


Do you know what's wrong with it?
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
Did You reboot the machine?
 

Rosin0416

Patron
Joined
Apr 11, 2016
Messages
214
Hello,
Yes.

Do you see anything wrong with the peer configuration files?
 

Rosin0416

Patron
Joined
Apr 11, 2016
Messages
214
Bingo, I did it.
I generated new key pairs, and restarted the server.
The ifconfig wg0 command returned this:
root@truenas[~]# ifconfig wg0
wg0: flags=80d2<UP,RUNNING,NOARP,MULTICAST> metric 0 mtu 1520
options=80000<LINKSTATE>
inet 100.100.100.1 netmask 0xffffff00
groups: wg
nd6 options=108<PERFORMNUD,IFDISABLED,NO_DAD>
root@truenas[~]#


1] Some elements of the command return are different from what is shown on the official documentation (https://www.truenas.com/docs/core/c...with-wireguard-configuration-to-apply-at-boot) :
wg0DeviceOutput.png

For example,
=> on the first line : they have "POINTTOPOINT" and I have "NOARP ;
=> on the second line : they have "192.168.X.X --> 192.168.X.X" and I have "100.100.100.1 netmask 0xffffff00 ;
=> on the last line : I have "IFDISABLED" and they have nothing.

Do I need to change things, or does that seem like a good idea?


2] Now the connection seems to be established. How do I access my smb shares in windows explorer?
As soon as I connect through the VPN, I can't access them anymore.


Regards
 

Rosin0416

Patron
Joined
Apr 11, 2016
Messages
214
Good new,

I managed to access my remote shares.
I had trouble finding it but once the connection is established, you have to enter the ip address of the vpn tunnel NAS in the address bar of the file browser.

What about my point 1 ?
Could someone tell me if my configuration is good, especially in terms of security?
 

Rosin0416

Patron
Joined
Apr 11, 2016
Messages
214
another question, If I add a peer in the /root/wg0.conf file, is it possible to restart / load the new configuration file without restarting the server?
 

Rosin0416

Patron
Joined
Apr 11, 2016
Messages
214
hello

no one can help me?
regards
 
Top