{"id":19984,"date":"2022-05-05T14:15:56","date_gmt":"2022-05-05T12:15:56","guid":{"rendered":"http:\/\/www.firewallhardware.it\/pfsense-e-opnvpn-accessi-a-tempo-per-openvpn-e-limitazioni-sulla-lan\/"},"modified":"2022-05-05T15:17:52","modified_gmt":"2022-05-05T13:17:52","slug":"pfsense-schedule","status":"publish","type":"post","link":"https:\/\/blog.miniserver.it\/en\/pfsense\/pfsense-schedule\/","title":{"rendered":"pfSense Schedule for OpenVPN Access"},"content":{"rendered":"<p>In this guide we will see how to limit, and thus make more limited the access of users who connect from the outside in <strong>VPN<\/strong> via our <a href=\"https:\/\/blog.miniserver.it\/en\/pfsense\/\" target=\"_blank\" rel=\"noopener\"><strong>pfSense<\/strong> <\/a>to the LAN.<\/p>\n<p>By means of a time schedule, it will be possible to limit the accesses of the clients that connect with <strong>OpenVPN<\/strong> and create restrictions on the accesses of the individual servers and devices.<\/p>\n<h3 style=\"color: #00a0df; font-size: 20px; text-align: left;\">Used Hardware:<\/h3>\n<p>This guide can be applied to all the <a href=\"https:\/\/www.miniserver.store\/firewall\" target=\"_blank\" rel=\"noopener\">hardware certified by us of the firewall line<\/a>.<\/p>\n<h3 style=\"color: #00a0df; font-size: 20px; text-align: left;\">Software environment:<\/h3>\n<p><a href=\"https:\/\/www.pfsense.org\/download\/\" target=\"_blank\" rel=\"noopener\"><strong>pfSense\u00ae 2.4.x<\/strong><\/a><\/p>\n<h3 style=\"color: #00a0df; font-size: 20px; text-align: left;\">Access Schedule for OpenVPN users:<\/h3>\n<p>To allow access of our users only in a time interval it is necessary to create a schedule that will be useful to us on several occasions.<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>We proceed by going to Firewall \/ Schedules \/ and press the Add button.<\/li>\n<li>In &#8220;Schedule Name&#8221; it is necessary to give a name to our schedule.<\/li>\n<li>At this point we will select the month to apply it and the days by clicking on the single day of the calendar,<\/li>\n<li>select the time range and click on &#8220;Add Time&#8221;.<\/li>\n<li>Repeat the procedure to add another time \/ date range to be assigned to this schedule.<\/li>\n<li>All created ranges will be displayed under &#8220;Configured Ranges.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19806\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo1.jpg\" alt=\"OpenVPN pfSense Accessi a Tempo\" width=\"800\" height=\"692\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo1-300x260.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo1-768x664.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo1.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>Here&#8217;s what our completed schedule will look like.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19808\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo2.jpg\" alt=\"OpenVPN pfSense Accessi a Tempo\" width=\"800\" height=\"234\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo2-300x88.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo2-768x225.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo2.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>At this point, in order to implement the scheduling created in the Firewall Rules, it is necessary to assign a very specific static IP address of the VPN tunnel to the user \/ s we want to limit.<\/p>\n<p>This is necessary because the firewall manages the rules via IP addresses.<\/p>\n<p>To assign a static IP address to the user, we will proceed as follows:<\/p>\n<ul>\n<li>go to VPN\/OpenVPN\/Client Specific Overrides and press the &#8220;Add&#8221; button<\/li>\n<\/ul>\n<p>In the configuration screen that will appear, it will be sufficient to configure only 2 items:<\/p>\n<ul>\n<li>&#8220;Common Name&#8221;: the name of the VPN user<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19810\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo3.jpg\" alt=\"OpenVPN pfSense Accessi a Tempo\" width=\"800\" height=\"405\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo3-300x152.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo3-768x389.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo3.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<ul>\n<li>&#8220;Advanced&#8221;: we will have to insert the following string ifconfig-push [IP_TUNNEL] [NETMASK]<\/li>\n<\/ul>\n<p>Where IP_TUNNEL will be the IP address of the tunnel that we would like to be assigned to the user.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19812\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo4.jpg\" alt=\"OpenVPN pfSense Accessi a Tempo\" width=\"800\" height=\"370\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo4-300x139.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo4-768x355.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo4.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>We repeat the procedure for each user we are interested in managing.<\/p>\n<p><strong>Access management and restriction for OpenVPN users<\/strong><br \/>\nWe can now implement our schedule created previously in the Firewall Rules to regulate user access and limit or allow access to individual servers.<\/p>\n<p><strong>It will be explained how to allow access to a server at a certain time, only to a specific user who connects via VPN<\/strong><br \/>\nLet&#8217;s start by going under Firewall \/ Rules and positioning ourselves under the &#8220;OpenVPN&#8221; interface, press the &#8220;Add&#8221; button to create a new rule to be placed at the top.<\/p>\n<p>Select &#8220;Any&#8221; as protocol and in &#8220;Source&#8221; enter the IP address belonging to the VPN Tunnel network defined previously and assigned to the user concerned.<\/p>\n<p>In &#8220;destination&#8221; we can enter in &#8220;Single host or alias&#8221; the IP address of the server to which we want to restrict the user&#8217;s connection.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19814\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo5.jpg\" alt=\"OpenVPN pfSense Accessi a Tempo\" width=\"800\" height=\"645\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo5-300x242.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo5-768x619.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo5.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>Finally, let&#8217;s position ourselves on &#8220;Advanced Options&#8221; and in the &#8220;Schedule&#8221; item select the Schedule created previously.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19816\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo6.jpg\" alt=\"OpenVPN pfSense Accessi a Tempo\" width=\"800\" height=\"1181\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo6-203x300.jpg 203w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo6-694x1024.jpg 694w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo6-768x1134.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo6.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>In this way we have allowed the user &#8220;john&#8221; who connects in VPN with the IP address of the Tunnel 10.20.30.20 to access only the server 192.168.2.55 during the time range established in the scheduling.<\/p>\n<p>We can repeat the procedure for each user to whom we want to grant access to the server at a certain time range.<\/p>\n<p>At this point, to prevent the user from accessing other devices on the network, we create a rule that blocks access to everything. This rule must be placed UNDER the previously created access rules and associated with it.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19818\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo7.jpg\" alt=\"OpenVPN pfSense Accessi a Tempo\" width=\"800\" height=\"785\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo7-36x36.jpg 36w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo7-71x71.jpg 71w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo7-300x294.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo7-768x754.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo7.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>Here is how the created rules will appear, to note that the symbol in correspondence with the &#8220;schedules&#8221; is green if at that moment we meet the rules described in our schedule.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19820\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo8.jpg\" alt=\"OpenVPN pfSense Accessi a Tempo\" width=\"800\" height=\"246\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo8-300x92.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo8-768x236.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo8.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>It will be yellow instead when we are out of the scheduling range and therefore you will not have access.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-19822\" src=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo9.jpg\" alt=\"OpenVPN pfSense Accessi a Tempo\" width=\"800\" height=\"245\" srcset=\"https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo9-300x92.jpg 300w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo9-768x235.jpg 768w, https:\/\/blog.miniserver.it\/wp-content\/uploads\/firewallhardwareOpenVPNpfSenseAccessiTempo9.jpg 800w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide we will see how to limit, and thus make more limited the access of users who connect from the outside in VPN via our pfSense to the LAN.<\/p>\n","protected":false},"author":11,"featured_media":25127,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[124],"tags":[270,138],"class_list":["post-19984","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pfsense","tag-openvpn-e-pfsense-en","tag-pfsense-en"],"_links":{"self":[{"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/posts\/19984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/comments?post=19984"}],"version-history":[{"count":9,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/posts\/19984\/revisions"}],"predecessor-version":[{"id":25126,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/posts\/19984\/revisions\/25126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/media\/25127"}],"wp:attachment":[{"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/media?parent=19984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/categories?post=19984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.miniserver.it\/en\/wp-json\/wp\/v2\/tags?post=19984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}