FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
lgupta
Staff
Staff
Article Id 333929
Description This article describes how it is possible to block a certain country and allow the rest of the world to connect to SSL VPN.
Scope FortiOS.
Solution

Step 1: Go to Policy & Objects -> Addresses, select 'Create new', select 'Geography' as the address Type, and select the country to block.

 

1.png

 

If it is desired to block more than one country, make an address group on the firewall. 

After creating the country on the addresses, the same must be mapped on the firewall SSLVPN settings to restrict access.

Step 2: Go to VPN -> SSL-VPN Settings and under 'Restrict Access', select 'Limit access to specific hosts' and add the address object created in Step 1.

 

2.png

 

Until here, it is only allowed connections from Blocked_Country, BUT it is desired to block the connection. So, it will be negated the source as explained in the next step.

 

Step 3: Run the following CLI command to Negate the source.

 

config vpn ssl settings

    set source-address-negate enable

end

3.png

 

Now, with this configuration setup, it should be possible to block a certain country and allow the rest of the world to connect to an SSL VPN.

 

Note: Sometimes this option (set source-address-negate enable) is not available under config authentication-rule.

This happens when there is no source-interface or source-address defined on the vpn ssl settings . Under authentication-rule,  source-interface and source-address should be set. After this, 'set source-address-negate' option should become available :

 

config vpn ssl settings

    set source-interface "wan1"
    set source-address "Blocked_Country"

end

 

Related articles:

Technical Tip: Restricting SSL VPN connectivity from certain countries using firewall geography addr...

Technical Tip: Commands to verify GeoIP information and troubleshoot GeoIP database

Technical Tip: How to block SSL VPN Connection from a certain source IP Address