TechBuzzPro

Block Synology Access by Country: Step-by-Step

· 6 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If you want to stop users from other countries reaching your Synology NAS, the built-in firewall can block or allow traffic based on geographic location. This adds a strong first line of defense against brute-force attacks and unwanted scans, while still letting you and your local users connect normally. You only need access to the Synology DSM web interface and an administrator account.

What You'll Need

  • Synology NAS running DSM 6.2 or later (the steps below use DSM 7, but the menu names are nearly identical in 6.2).
  • An administrator account (usually admin or a user in the administrators group).
  • Your public IP address (to whitelist yourself if you travel, but not strictly required).

Step-by-Step

  1. Log in to DSM. Open your browser, go to your NAS's IP or hostname (e.g., https://192.168.1.100:5001), and sign in with an administrator account.
  2. Open the Control Panel. Click the Main Menu (grid icon in the top-left corner), then select Control Panel.
  3. Go to Security > Firewall. In the Control Panel, click Security, then switch to the Firewall tab.
  4. Enable the firewall. If the firewall is off, check the box Enable firewall and click Apply. This activates the default rules (usually allow all).
  5. Create a new rule. Click Create (or Add) to open the rule editor.
  6. Name the rule. Enter a descriptive name like Block Foreign Countries.
  7. Set the action to Deny. In the Action dropdown, choose Deny.
  8. Select the protocol and port. For most users, leave Protocol as All or choose TCP if you only want to block web/SSH. If you want to block all access, choose All. For Port, you can leave it as All or specify a single port (e.g., 5001 for HTTPS).
  9. Choose the source type. Under Source IP, select Geo IP from the dropdown. This option appears only after you have enabled the firewall and saved at least once.
  10. Pick the countries to block. A list of countries appears. Select the ones you want to block. You can use the search box to find a country quickly. For example, if you want to block all traffic from Russia and China, select those two. If you want to block everything except your own country, you'll need to create a separate allow rule first (see Tips).
  11. Save the rule. Click OK. The rule appears in the list. Make sure it is placed above any “Allow” rules that might conflict. You can drag rules to reorder them; the first matching rule wins.
  12. Test your rule. From a device outside the blocked country (or using a VPN that appears to be in a blocked country), try to access your NAS. It should time out or refuse the connection. If you accidentally blocked yourself, you can still access DSM from the local network (LAN) because the firewall rule applies to external interfaces by default, but double-check if you are testing remotely.

Common Mistakes

  • Placing the Deny rule below an Allow-all rule. If you have an existing “Allow All” rule at the top, your Deny rule will never trigger. Always move the Deny rule above any broad Allow rules.
  • Blocking your own country. If you travel and your IP changes to a blocked country, you'll lock yourself out. Keep a rule that allows your known home IP or use a VPN that exits in an allowed country.
  • Forgetting that Geo IP is based on IP registration. A user using a VPN that exits in a non-blocked country will still get through. Geo IP is not a perfect security measure.
  • Not enabling the firewall. You must click Apply after checking the box, otherwise your rules do nothing.
  • Blocking all ports. If you block all ports, you also block DSM's own web interface, making remote management impossible. Consider blocking only the ports you expose (e.g., 22, 443, 5001).

Tips

  • Whitelist your own IP first. Before blocking a country, create an Allow rule for your home IP address (or your office's static IP). Place it at the top. This ensures you never lose access even if your ISP's IP range is misclassified.
  • Use a separate rule for each service. If you run a web server on port 80 and SSH on 22, create two Deny rules: one for port 80, one for 22. This gives you finer control.
  • Combine with Auto Block. In Security > Account, enable Auto Block to automatically ban IPs after repeated failed logins. This works alongside Geo IP.
  • Test with a VPN. Use a free or paid VPN that exits in a country you plan to block, then try to connect. This is the easiest way to verify the rule works.
  • Update the Geo IP database. Synology updates the Geo IP database automatically, but you can manually trigger an update in Security > Firewall > Geo IP if you suspect it's outdated.

Troubleshooting

I can't access my NAS from outside after adding the rule.
This usually means you blocked your own country or your IP is misclassified. Log in from the LAN (e.g., via http://192.168.1.100:5000), go to Firewall, and temporarily disable the rule or add an Allow rule for your current public IP at the top. If you don't know your public IP, visit whatismyip.com from a device on the same network.

The Geo IP option is grayed out.
Make sure the firewall is enabled and you've clicked Apply. If it's still gray, restart the firewall service by toggling it off and on. In rare cases, you may need to update DSM.

Users in blocked countries can still connect.
They might be using a VPN that exits in an allowed country, or your rule is not ordered correctly. Check the rule order: Deny rules must be above any Allow rules that cover the same port. Also verify that the rule's port matches the service (e.g., port 443 for HTTPS, not 5001).

The firewall blocks all traffic, even from my LAN.
By default, firewall rules apply to external interfaces (WAN), but if you set “All Interfaces” in the rule's interface field, you may block LAN traffic too. Edit the rule and set Interface to WAN (or the specific external interface) to only affect incoming internet traffic.

I accidentally blocked my own country and now I'm locked out remotely.
If you still have LAN access, fix it from there. If you're completely locked out, use Synology's Reset button on the back of the NAS (hold for 4 seconds until you hear a beep) to reset the admin password and re-enable default firewall settings. This does not erase data.

Frequently Asked Questions

Does Geo IP blocking work for IPv6?
Yes, but the Geo IP database may be less accurate for IPv6 addresses. It's still worth enabling, but don't rely on it as your only defense.

Can I block a country but allow a specific IP from that country?
Yes. Create an Allow rule for that specific IP and place it above the Deny rule. The firewall processes rules top-down, so the Allow rule will match first.

Will this affect my local network speeds?
No. The firewall only inspects incoming traffic from the internet. LAN-to-NAS traffic is not subject to these rules unless you specifically set the interface to LAN.

How often is the Geo IP database updated?
Synology updates it periodically, usually every few weeks. You can manually update by going to Security > Firewall > Geo IP and clicking Update Now.

Can I block a country for only one user account?
No. The firewall works at the network level, not per user. To restrict a specific user, you'd need to use DSM's application permissions or set up a VPN for that user.

Does this block all traffic from that country, including email?
It blocks all incoming connections to your NAS based on the source IP. If you run a mail server on the NAS, that will also be blocked. Outgoing traffic from your NAS to that country is not affected.