Description |
This article describes a practical approach to safeguarding the network by denying connections from IPs originating in China. |
Scope | FortiGate. |
Solution |
Navigate to 'System' and access 'Feature Visibility'. Confirm whether 'Local in Policy' is enabled.
Configure the local-in policy by setting the appropriate parameters: And in the service, it is all defined, because it is necessary to block all connections coming to the firewall in any port number.
By following these steps, it is possible to effectively block connections originating from specific country IP ranges, ensuring enhanced security for the FortiGate.
The next tip on the same topic is a bonus tip in case there is a need to allow only one country to connect to the firewall and all of the other countries to be blocked. In this example, all of the countries except China will be blocked :
The following is achieved with the use of 'set srcaddr-negate enable' which would block all of the addresses except the one configured in 'srcaddr'. One friendly reminder is that the default action in local policies is denied, therefore there is no need to configure it.
From v7.4.6 there is a behavior change in the interface selection in Local-in policy. if the interface is a member of the SD-wan Zone then that individual interface cannot be selected in Local-in-policy. The solution is to configure the Local-in policy with the interface as the SD-Wan zone instead of the individual interface.
This behavior also affects when FortiGate is upgraded from any previous version to v7.4.6 the Local-in policy which is configured with an individual interface will be deleted after the upgrade it has to be manually configured again with the interface as the SD-WAN zone
Related documents: Technical Tip: ESP Packets are not blocked by local-in policy |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.