Technical Tip: Configuring FortiGate policy to block traffic for one or more IP addresses
| Description | This article describes how to block an IP address. |
| Scope | FortiGate. |
| Solution | To block an IP address, create an address entry and create a firewall policy to block the address.
Create an Address Object.
Note that if blocking an internal IP address, set the netmask to 255.255.255.255, or /32. Otherwise, it could block the entire subnet.
CLI commands:
set subnet 172.16.1.30 255.255.255.255 next
Create a Firewall Policy.
Creating Firewall policy from CLI use below commands:
config firewall policy set action deny <----- Action to deny logs.
Note: FortiGate checks firewall policies in order, starting from the top of the list. As soon as it finds a match for the traffic, it uses that policy and stops looking further. Therefore, it is recommended that the blocking policy be placed above any existing allow policy that matches the same traffic. |


