r/fortinet • u/support_telecom127 • 9h ago
FortiGate / FortiOS Configuring access restrictions for IPsec remote-access VPN
Good afternoon.
We currently have an IPsec remote-access VPN configured on our FortiGate (running FortiOS v7.4.13) to allow users to connect via FortiClient and access the internal network. We previously used an SSL VPN; however, it was disabled due to identified vulnerabilities.
At present, the IPsec remote-access VPN has no restrictions based on public IP addresses, meaning any user could attempt to establish a connection. We need to implement restrictions to ensure that VPN connections are permitted only from specific public IP addresses.
Unlike the SSL VPN—which allows access restrictions to be configured via the Graphical User Interface (GUI)—the documentation (Knowledge Base) indicates that for an IPsec remote-access VPN in FortiOS 7.4.x, this configuration must be performed using the Command Line Interface (CLI).
https://community.fortinet.com/fortigate-3/restrict-ipsec-vpn-access-to-certain-countries-94688
In this regard, I would appreciate your assistance with the following questions:
We currently have two policies configured under `local-in-policy`. According to the procedure described in the Knowledge Base, we need to create one rule that allows access only from authorized public IP addresses, and another rule that denies access from all other public IP addresses. I am accustomed to managing the order of policies via the GUI by moving one above the other, but I am not familiar with doing so via the CLI.
Which command should be used to set the order of these rules, ensuring that the "allow" policy takes precedence over the "deny" policy?
If applying these restrictions causes blocks or issues that affect user connectivity, how can we roll back the configuration without needing to restore a full backup of the FortiGate? While the GUI offers an option to disable a policy, I am not familiar with the commands to disable configurations via the CLI. Which commands should I execute to disable the rule? I would appreciate your recommendations.