{"id":98201,"date":"2020-10-24T20:42:36","date_gmt":"2020-10-24T18:42:36","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/nastrojka-na-nas-synology-openvpn-servera-po-tipu-site-to-site"},"modified":"2020-11-18T00:58:46","modified_gmt":"2020-11-17T22:58:46","slug":"nastrojka-na-nas-synology-openvpn-servera-po-tipu-site-to-site","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nastrojka-na-nas-synology-openvpn-servera-po-tipu-site-to-site","title":{"rendered":"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Hello everyone!<\/p>\n<p>I know that there are many resources regarding OpenVPN settings. However, I found that there is a lack of organized information on the subject, so I decided to share my experience primarily with those who are not gurus in OpenVPN administration but would like to achieve site-to-site connectivity on a Synology NAS. This will also serve as a reminder for myself.<\/p>\n<p>So, I have a Synology NAS DS918+ with the package <a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/en\/vpn\/\"   title=\"VPN\" data-wpil-keyword-link=\"linked\"  data-wpil-monitor-id=\"138\">VPN<\/a> Server installed, configured with OpenVPN, and users who can connect to the VPN server. I won't go into the details of the server setup in the DSM interface (the web portal of the NAS). This information is available on the manufacturer's website.<\/p>\n<p>The issue is that the DSM interface (as of the publication date, version 6.2.3) has a limited number of settings for managing the OpenVPN server. In our case, a site-to-site connection is required, i.e., the hosts of the VPN client subnet should see the hosts of the VPN server subnet, and vice versa. The standard settings available on the NAS only allow access from the VPN client subnet hosts to the VPN server subnet hosts.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nTo configure access to the client subnets from the VPN server subnet, we will need to access the NAS via SSH and manually edit the OpenVPN server configuration file.<\/p>\n<p>For editing files on the NAS via SSH, I prefer using Midnight Commander. To do this, I connected the source in the Package Center <noindex><a rel=\"nofollow\" href=\"http:\/\/packages.synocommunity.com\">packages.synocommunity.com<\/a><\/noindex> and installed the Midnight Commander package.<\/p>\n<p><img decoding=\"async\" alt=\"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration\" src=\"\/wp-content\/uploads\/2020\/10\/9cc26a1e49c2973602a713ef2ea857dd.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nWe access the NAS via SSH using an administrator account.<\/p>\n<p><img decoding=\"async\" alt=\"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration\" src=\"\/wp-content\/uploads\/2020\/10\/80b67cf30647ab3e35093efb70d29e32.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nWe type 'sudo su' and enter the administrator password again:<\/p>\n<p><img decoding=\"async\" alt=\"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration\" src=\"\/wp-content\/uploads\/2020\/10\/cc7ee2932b9bc3b3e0eb5bbe78b40255.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nWe enter the command 'mc' to launch Midnight Commander:<\/p>\n<p><img decoding=\"async\" alt=\"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration\" src=\"\/wp-content\/uploads\/2020\/10\/05fbfd1016c96a045ffeeda33cfdd724.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNext, we navigate to the directory \/var\/packages\/VPNCenter\/etc\/openvpn\/ and find the file openvpn.conf:<\/p>\n<p><img decoding=\"async\" alt=\"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration\" src=\"\/wp-content\/uploads\/2020\/10\/4a9dd4d3f0d245fb939e5992a119b812.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nOur task is to connect 2 remote subnets. To do this, we create 2 accounts on the NAS through DSM with restricted rights to all NAS services and provide access only to the VPN connection in the VPN Server settings. For each client, we need to set a static IP assigned by the VPN server and route the traffic from the VPN server subnet to the VPN client subnet through this IP.<\/p>\n<p>Input data:<\/p>\n<p>VPN server subnet: 192.168.1.0\/24.<br \/>\nOpenVPN server address pool 10.8.0.0\/24. The OpenVPN server itself receives the address 10.8.0.1.<br \/>\nVPN client subnet 1 (VPN user): 192.168.10.0\/24, needs to receive a static address 10.8.0.5 from the OpenVPN server.<br \/>\nClient VPN subnet 2 (user VPN-GUST): 192.168.5.0\/24 must obtain a static address 10.8.0.4 on the OpenVPN server.<\/p>\n<p>In the settings directory, create a folder named ccd and create configuration files with names corresponding to the user logins.<\/p>\n<p><img decoding=\"async\" alt=\"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration\" src=\"\/wp-content\/uploads\/2020\/10\/9013b4604d703b800088db7e4ff15461.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nFor the VPN user, we write the following settings in the file:<\/p>\n<p><img decoding=\"async\" alt=\"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration\" src=\"\/wp-content\/uploads\/2020\/10\/152edcc01984b9bbe9220e905eff2c19.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nFor the VPN-GUST user, we write the following in the file:<\/p>\n<p><img decoding=\"async\" alt=\"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration\" src=\"\/wp-content\/uploads\/2020\/10\/ae136680d7d968575ae75da0ad196365.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nNow we just need to fine-tune the OpenVPN server configuration \u2014 add a parameter for reading client settings and add routings to the client subnets:<\/p>\n<p><img decoding=\"async\" alt=\"Setting up an OpenVPN server on NAS Synology in a site-to-site configuration\" src=\"\/wp-content\/uploads\/2020\/10\/dde934e6f80188191a71e198b789d2de.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nIn the provided screenshot, the first 2 lines of the config are configured using the DSM interface (checking the box for the parameter 'Allow clients to access the server's local network' in the OpenVPN server settings).<\/p>\n<p>The line client-config-dir ccd indicates that client configurations are located in the ccd folder.<\/p>\n<p>The next 2 configuration lines add routes to the client subnets through the corresponding OpenVPN gateways.<\/p>\n<p>And finally, for correct operation, it is necessary to apply the subnet topology.<br \/>\nDo not touch any other settings in the file.<\/p>\n<p>After entering the settings, remember to restart the VPN Server service in the package manager. In the hosts or gateway for the subnet, specify routes to the client subnets via the NAS.<br \/>\nIn my case, the gateway for all hosts in the subnet where the NAS is located (its IP is 192.168.1.3) was the router (192.168.1.1). On this router, I added routing entries for networks 192.168.5.0\/24 and 192.168.10.0\/24 to the gateway 192.168.1.3 (NAS) in the static routing table.<\/p>\n<p>Don't forget that with the firewall enabled on the NAS, it will also need to be configured. Additionally, a firewall may be enabled on the client side, which will also need to be configured.<\/p>\n<p>P.S. I am not a professional in networking technologies and particularly in working with OpenVPN, I\u2019m just sharing my experience and publishing the configurations that I created, which allowed me to set up communication between subnets in a site-to-site manner. There may be simpler and\/or more correct configurations, and I would be glad if you share your experience in the comments.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/524758\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u0442\u0435\u043c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 OpenVPN \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e. \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u0430\u043c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0442\u0435\u043c\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0435\u0442 \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441 \u0442\u0435\u043c\u0438, \u043a\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u0443\u0440\u0443 \u0432 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 OpenVPN, \u043d\u043e \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 \u043f\u043e \u0442\u0438\u043f\u0443 site-to-site \u043d\u0430 NAS Synology. \u0417\u0430\u043e\u0434\u043d\u043e \u0438 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":98202,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-98201","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u0442\u0435\u043c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 OpenVPN \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nastrojka-na-nas-synology-openvpn-servera-po-tipu-site-to-site\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043d\u0430 NAS Synology OpenVPN \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e \u0442\u0438\u043f\u0443 site-to-site | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u0442\u0435\u043c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 OpenVPN \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nastrojka-na-nas-synology-openvpn-servera-po-tipu-site-to-site\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-10-24T18:42:36+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-11-17T22:58:46+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Configuration on NAS Synology OpenVPN server in a site-to-site manner | ProHoster","description":"Hello everyone! I know that many have made configurations for OpenVPN.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nastrojka-na-nas-synology-openvpn-servera-po-tipu-site-to-site","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043d\u0430 NAS Synology OpenVPN \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e \u0442\u0438\u043f\u0443 site-to-site | ProHoster","og:description":"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u0442\u0435\u043c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 OpenVPN \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nastrojka-na-nas-synology-openvpn-servera-po-tipu-site-to-site","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-10-24T18:42:36+00:00","article:modified_time":"2020-11-17T22:58:46+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"98201","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 10:03:30","updated":"2026-02-04 14:42:08","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/98201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=98201"}],"version-history":[{"count":1,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/98201\/revisions"}],"predecessor-version":[{"id":156767,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/98201\/revisions\/156767"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/98202"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=98201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=98201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=98201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}