Limit the access of users who connect through OpenVPN.
To allow access of our users only in specific time intervals it is necessary to create a schedule:
Navigate to Firewall → Schedules.
Click the Add button.
In Schedule Information:
NOTE: Repeat the procedure to add additional date/time ranges to this schedule.
All created ranges will be displayed under Configured Ranges.
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 users we want to limit.
To assign a static IP address to the user:
In the configuration screen that will appear, it will be sufficient to configure only 2 items:
ifconfig-push 10.20.30.69 255.255.255.0
NOTE: See: Assign a fixed IP to a remote client.
The format for the Advanced entry is: ifconfig-push [IP_TUNNEL] [NETMASK], where:
Repeat the procedure for each user to be managed.
Navigate to Firewall → Rules.
Select the OpenVPN interface.
Click Add button to create a new rule to be placed at the top.
NOTE: This allows a user who connects to the VPN with the IP address of the Tunnel 10.20.30.69 to access only the server 192.168.1.123 during the time range established in the scheduling.
Repeat the procedure for each user to whom you want to grant access to the server at a certain time range.
To prevent the user from accessing other devices on the network, an additional rule that blocks access to everything should be placed UNDER the previously created access rules and associated with it.
NOTE: The Firewall Rules will show under the Schedule column a symbol which will change color between Green and Yellow.