Back to Guides

macOS & Networking

Connecting your Mac to a NAS over a VPN

Quiet Form Labs4 min read

If you can already open shared folders on your NAS or another SMB server from your Mac, a VPN can give you access to those same folders when you’re away from home or the office.

This guide starts with a working VPN and shows how to test one shared folder in Finder, what can happen to its mount path when you move networks, and how Anchor can remount your shares.

What the VPN does

A VPN creates an encrypted connection between your Mac and a device or network you’re allowed to reach. Tailscale can connect your Mac directly to a NAS running Tailscale. A VPN on your router, or a Tailscale subnet router, can instead give your Mac a route to the NAS’s local address.

You need a VPN configured to reach your home or office network or the NAS itself. A typical privacy VPN that sends web traffic through a provider’s server won’t give you that access. Once the VPN is connected, macOS still uses SMB and your usual NAS account to open the shared folders.

Your Mac/Volumes/Projects
SMB over VPN
NAS or server Projects
The share appears as a volume on your Mac. Its files stay on the server.

Find the address your Mac can reach over the VPN

Connect your Mac to the VPN that gives you access to your NAS. If Tailscale runs on the NAS itself, use the NAS’s Tailscale IP address or its MagicDNS name. If your VPN routes traffic to your home or office network, you may be able to use the NAS’s usual local IP address.

Use the address of the NAS that hosts the share. If a separate device runs the VPN and routes traffic to the NAS, its own address is usually different.

You can also use the full MagicDNS hostname. It combines the device name and your tailnet’s DNS name. For example, if the NAS is called atlas and the tailnet’s DNS name is magic-maker.ts.net, use atlas.magic-maker.ts.net.

Try one shared folder in Finder

  1. With the VPN connected, open Finder and press Command-K to open Connect to Server.
  2. Enter the NAS address and share name. For example, if your NAS has the full MagicDNS hostname atlas.magic-maker.ts.net and the share is called Projects, enter the address below.
  3. Click Connect and sign in with the NAS account that has access to the folder.
smb://atlas.magic-maker.ts.net/Projects

Test from a different network, such as your phone’s hotspot or guest Wi-Fi, so you know the connection works away from home. You can enter the SMB address directly even if the NAS is missing from Finder’s Network view.

If the name fails, try the IP address your VPN makes reachable. If neither works, check that the VPN allows access to the NAS and that SMB is enabled. If Finder reaches the NAS but rejects your login, check the share name and your NAS account’s permissions.

What happens to Finder mounts when you switch networks?

Finder works well for testing a connection or mounting a share as you need it. If you regularly use several shares, you still need to mount each one. If you save shortcuts to individual shares, you’ll need to set those up for each share and keep track of which address to use on each network.

When you switch networks, it’s up to you to check which shares are still mounted and reconnect any that haven’t appeared. If you leave Wi-Fi with a share open, the SMB session can stall or disconnect. Even after the VPN connects, you may need to eject the old mount and connect again. If macOS hasn’t released it, close any apps or files still using the share and give it time before trying again.

Finder mounts an SMB share such as Projects under /Volumes/Projects. If that path is still occupied when you connect again, macOS can mount the share at /Volumes/Projects-1. This can also happen when two servers offer shares with the same name. The folder name you see in Finder can look familiar even when the path has changed.

/Volumes/Projects
and
/Volumes/Projects-1
A familiar share name can appear with a numbered suffix.

An editing project, backup job or script that expects /Volumes/Projects can then report missing files or keep trying the old mount. Close files before switching networks, and check the actual mount path before relinking files or restarting a job. See our guide to macOS network shares and duplicate volumes for more on this.

Keep the same shares in Anchor

Anchor is a Mac menu bar app for mounting and automounting SMB shares. If you use the same NAS over Wi-Fi at home and over Tailscale or another VPN away from home, Anchor 1.1 lets you give that server two addresses. Keep the local hostname or IP as Primary and add the VPN hostname or IP as the Alternate Address. Your existing shares stay under the same server.

Set every enabled share to Anchor Managed credentials. Then open Settings → Servers → Advanced, choose Alternate Address… from the server’s menu, enter the VPN address and use Test Addresses to make sure the connections are working. Turn on Enable Alternate Address, save and test mounting on both networks. Keep using your VPN app to connect as usual. You only need to confgure Anchor once - your shares are then easily available via the menu bar dropdown whenever you need them.

Switch networks without mounting each share again

When you know you’re about to leave the local network, save your work and close any files you have open on the NAS. Use Prepare for Network Change in Anchor before you disconnect. Anchor releases your mounted Dual Path shares and remembers which ones to restore, including shares with Automount turned off.

Once you’re on the new network and the VPN is connected, Anchor can restore those shares through the available address. The same workflow works in reverse when you get back. Releasing the old mount before switching can help avoid a numbered path, though macOS still chooses the mount point. If the connection drops unexpectedly, Anchor waits for macOS to release the interrupted mount before it can reconnect shares with Automount enabled.

See Anchor Help for the full setup and what’s new in Anchor 1.1 for a look at the network change workflow. If you’re still having trouble finding the server, see why your Mac might not find your NAS.

For a worked example, see how to move two mounted shares from home Wi-Fi to Tailscale.