Trying to map drives from synology nas to Windows over cloudflare tunnel

Trying Cloudflare tunnel for the first time. I have already setup docker container with cloudflared in synology nas and I can successfully access the Synology management webpage through a client device over the internet.
But my team needs access to the files in the NAS, So ideally would like to map the folders as drives over the internet in windows explorer just like smb shared files in local network. Not able to do this. Tried the steps mentioned in this article using cloudflared

[type or paste code here](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/use_cases/smb/#connect-to-smb-server-with-cloudflared-access)

But cannot connect. Dont know how to setup docker to execute two commands at startup ( one with the token to connect to the tunnel and the other to provide access to the file sharing port as mentioned in the above help page).

Please help out

hi @agrimagc. You can open the running container using docker exec command.

  1. Add one startup command to your docker file and run it
    docker run <image-name>

  2. open the running container using
    docker exec -it <container-id> sh

You can try this and see if that solves the issue:

Dont know how to setup docker to execute two commands at startup

Make sure:

  • you have upgraded to the latest version of cloudflared.
  • Ensure the required ports and IPs are allowed (where necessary) for Tunnels and our API.
  • Make sure to follow the debugging steps here the cloudflared logs is the source of truth here, and will show you quite many things to check on debug mode.

Note here that there are 2 ways today to create tunnels, and multiple ways to add the required debugging flags:
The instructions regarding setting up the logs above need to be followed differently depending on whether you set up your tunnel locally, or remotely (via the dashboard):

Hi, did you get it working? If yes, can you please share your full setup? Everything from the Tunnel creation to the settings in the container.

I would really appreciate it!!

This is precisely what I am trying to configure for my team, but I can’t get into the docker container to change the configs:

root@Backshare:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3ef8a6fa4298 cloudflare/cloudflared:latest “cloudflared --no-au…” 5 weeks ago Up 2 days cloudflare-cloudflared1
root@Backshare:~# docker exec -it 3ef8a6fa4298 sh
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: “sh”: executable file not found in $PATH: unknown
root@Backshare:~# docker exec -it 3ef8a6fa4298 /bin/sh
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: “/bin/sh”: stat /bin/sh: no such file or directory: unknown
root@Backshare:~# docker exec -it 3ef8a6fa4298 /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: “/bin/bash”: stat /bin/bash: no such file or directory: unknown
root@Backshare:~# docker exec -it 3ef8a6fa4298 /usr/bin/sh
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: “/usr/bin/sh”: stat /usr/bin/sh: no such file or directory: unknown
root@Backshare:~# docker exec -it 3ef8a6fa4298 /usr/bin/bash
OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: “/usr/bin/bash”: stat /usr/bin/bash: no such file or directory: unknown

Where’s the shell?

All the configuration you need is in the Zero Trust part of the Cloudflare website.

Go to Tunnels and edit the Synology tunnel. Click the Private Network part and add a CIDR for your network - in my case, 192.168.2.0/24 covers the entire subnet my Synology NAS is connected to.

You can now access your network when the WARP client is installed, and the user is logged to your Zero Trust account.

1 Like