Nordlynx on Synology NAS #41
-
Hi all, It seems to be non-trivial to configure the Nordlynx container so that it runs successfully on Synology NAS. The main forum for the discussion used to be #1, but it seems about right to move the comments into a dedicated discussion. Not only does #1 get to be an actual welcome, but also this makes it much easier for others to find and refer to the discussion. The goal of this discussion is two-fold. First, we aim to find a working configuration for Synology NAS (to my knowledge that has not been shared yet). Doesn't have to be optimal, doesn't have to be fully understood. Second, with the community, we can extract a minimal configuration and possibly discuss some additions that relate to a common need. During and/or after this process, the results should be documented concisely in the wiki. I'm looking forward to our joint effort! |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 48 replies
-
First, I installed Wireguard on my Synology as explained here. Next, I could get started with Nordlynx. Below, you find (part of) my current docker compose file. This configuration runs successfully on Synology DS218+ for several days now (apart from seemingly random hickup that was also experienced by others, cf. #38). I don't particularly like services:
nordlynx:
image: ghcr.io/bubuntux/nordlynx:latest
container_name: nordlynx
restart: unless-stopped
security_opt:
- no-new-privileges:true
cap_add:
- NET_ADMIN
- NET_RAW
- SYS_MODULE
sysctls:
- net.ipv6.conf.all.disable_ipv6=1 # Recommended if using ipv4 only
ports:
- 51413:51413 # Transmission torrent TCP port
- 51413:51413/udp # Transmission torrent UDP port
volumes:
- /lib/modules:/lib/modules:ro # Required to install wireguard module
environment:
- PRIVATE_KEY=[INSERT_YOUR_KEY]=
- DNS=103.86.96.100,103.86.99.100,127.0.0.11
- ALLOWED_IPS=0.0.0.0/1,128.0.0.0/2
- NET_LOCAL=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 As mentioned in the OP, this is hopefully a working example for most of us. If it works for you, please indicate so through a comment or by upvoting. If it works for others as well, I'd like to optimize it together. I'm quite sure that it can be improved upon (e.g. the I'll walk through all arguments to motivate them and suggest topics of discussion.
|
Beta Was this translation helpful? Give feedback.
-
Starting on Synology NAS with Wireguard installed, please consider the following updated config proposal that includes the above fix for the # nordlynx.yml
services:
nordlynx:
image: ghcr.io/bubuntux/nordlynx:latest
container_name: nordlynx
restart: unless-stopped
security_opt:
- no-new-privileges:true
cap_add:
- NET_ADMIN
sysctls:
- net.ipv6.conf.all.disable_ipv6=1 # Recommended if using ipv4 only
ports:
- 51413:51413 # Transmission torrent TCP port
- 51413:51413/udp # Transmission torrent UDP port
env_file:
- nordlynx.env # nordlynx.env
PRIVATE_KEY=[INSERT_YOUR_KEY]=
ALLOWED_IPS=0.0.0.0/1,128.0.0.0/1
NET_LOCAL=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
POST_UP="ip -4 route add $(wg | awk -F'[: ]' '/endpoint/ {print $5}') via $(ip route | awk '/default/ {print $3}')"
PRE_DOWN="ip -4 route del $(wg | awk -F'[: ]' '/endpoint/ {print $5}') via $(ip route | awk '/default/ {print $3}')" One can make this work with the environmental variables in the compose file, which includes some escaping here and there, but I prefer to have it in somewhat less unreadable format. Optionally, one may add the following environmental variable: DNS=103.86.96.100,103.86.99.100,127.0.0.11 This line complements default nordlynx DNS by docker DNS. By doing so, containers behind nordlynx can resolve nordlynx and other containers that directly connect to the current docker network (e.g. not via nordlynx). Since docker DNS is not aware of the containers behind nordlynx, their names can not be resolved (as far as I know, but please correct me). Does this configuration look like a good (minimal) start? Please provide your feedback! If the community approves, I'll add it to the wiki. |
Beta Was this translation helpful? Give feedback.
-
After a pleasant joint troubleshooting effort with @ginodesilva, we have come to the following configuration for Synology NAS (Wireguard installed): services:
nordlynx:
image: ghcr.io/bubuntux/nordlynx:2022-03-01
container_name: nordlynx
restart: unless-stopped
security_opt:
- no-new-privileges:true
cap_add:
- NET_ADMIN
sysctls:
- net.ipv6.conf.all.disable_ipv6=1 # Recommended if using ipv4 only
environment:
- PRIVATE_KEY=[INSERT_YOUR_KEY]=
- ALLOWED_IPS=0.0.0.0/1,128.0.0.0/1
- NET_LOCAL=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
- "POST_UP=ip -4 route add $$(wg | awk -F'[: ]' '/endpoint/ {print $$5}') via $$(ip route | awk '/default/ {print $$3}')"
- "PRE_DOWN=ip -4 route del $$(route -n | awk '/255.255.255.255/ {print $$1}') via $$(ip route | awk '/default/ {print $$3}')" Synology specifics:
|
Beta Was this translation helpful? Give feedback.
-
I have a similar issue on a QNAP NAS, but with no changes it eventually works after stopping\restarting the container multiple times. |
Beta Was this translation helpful? Give feedback.
-
Does anyone have any idea how to properly escape these two env variables used with a
^ above doesn't work and results in:
Either does using an .env file formatted like
^ above results in:
I've tried so many different ways to escape the POST_UP/DOWN strings with no success 😖 |
Beta Was this translation helpful? Give feedback.
-
Hi my synology is connecting ok if I turn off the firewall if I turn it on this guy shows up "Unable to select a server ¯_(⊙︿⊙)_/¯" In the Synology firewall I add the port 51820 and in the docker compose I add the Listen_port 51820 but I can't get rid of that guy is there any other port I need to open in the firewall? here is my docker compose
|
Beta Was this translation helpful? Give feedback.
-
Hi all, I'm struggling to get the private key from NordVPN. The instructions to get it end up in a message that nordvpnd.sock is not found. |
Beta Was this translation helpful? Give feedback.
-
Hi This is my conf:
The logs say:
The nordlynx container status is unhealty.
What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
-
Getting the same as above... nothing but dropped packets...
version: '3.8'
services:
vpn:
container_name: vpn
image: ghcr.io/bubuntux/nordlynx:2022-03-01
restart: unless-stopped
security_opt:
- no-new-privileges:true
cap_add:
- NET_ADMIN
sysctls:
- net.ipv6.conf.all.disable_ipv6=1
- net.ipv4.conf.all.src_valid_mark=1
environment:
- "PRIVATE_KEY=XXXXX"
- ALLOWED_IPS=0.0.0.0/1,128.0.0.0/1
- NET_LOCAL=192.168.0.0/16
- "POST_UP=ip -4 route add $$(wg | awk -F'[: ]' '/endpoint/ {print $$5}') via $$(ip route | awk '/default/ {print $$3}')"
- "PRE_DOWN=ip -4 route del $$(route -n | awk '/255.255.255.255/ {print $$1}') via $$(ip route | awk '/default/ {print $$3}')" |
Beta Was this translation helpful? Give feedback.
After a pleasant joint troubleshooting effort with @ginodesilva, we have come to the following configuration for Synology NAS (Wireguard installed):