Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
AEF
New Contributor

drop an ip adresse with all protocols

Hi, how to drop a public IP address for all ports tcp and udp packets ? please can you show me all steps. Thank you.
5 REPLIES 5
emnoc
Esteemed Contributor III

Easy edit 0 set srcintf " wan1" set dstintf " internal" set srcaddr " 192.0.2.82" set dstaddr " all" set schedule " always" set service " ANY" set action deny <---- make action deny set comments BLOCKED For flooding " next

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
rwpatterson
Valued Contributor III

Also policies are read form the top to the bottom (of each source/destination pair). Make sure this deny is at or near the top of the list.

Bob - self proclaimed posting junkie!
See my Fortigate related scripts at: http://fortigate.camerabob.com

Bob - self proclaimed posting junkie!See my Fortigate related scripts at: http://fortigate.camerabob.com
emnoc
Esteemed Contributor III

good point. Another suggestion, if you have a rash of bad ip_addr to drop, create a address group, and apply that to a fwpolicy. Make it the #1 and just add address to that group. I have a group called blacklist that does exactly just this. config firewall address edit TEST-NET-1 set subnet 192.0.2.0/24 next edit TEST-NET-2 set subnet 198.51.100.0/24 next edit TEST-NET-3 set subnet 203.0.113.0/24 end config firewall addrgrp edit blacklisted set member TEST-NET-1 TEST-NET-2 TEST-NET-3 end than you apply blacklist as the source; set srcintf " wan1" set dstintf " internal" set srcaddr " blacklisted" set dstaddr " all" set schedule " always" set service " ANY" set action deny <---- make action deny set comments " blacklisted address " So now you have the one fwpolicy you move to the top and just append a address to the addressgroup

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
ede_pfau
SuperUser
SuperUser

Usually, there should be no need for an explicit DENY policy as you should not have a ' catch-all' policy allowing WAN hosts into your network. If you use VIPs for access from WAN then this might make sense though. In FOS 5.2, one can negate an address group: you can put the blacklisted addresses into one group and use it negated as source address in your VIP policy. Attack or login attempts targeting the Fortigate itself will NOT be denied by policies! You can either define ' trusted hosts' which are explicitly allowed or disallow administrative access from WAN altogether. The latter is what I recommend.
Ede Kernel panic: Aiee, killing interrupt handler!
Ede Kernel panic: Aiee, killing interrupt handler!
AEF
New Contributor

Hi thank you for your help,
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors