Created on
03-31-2016
09:09 PM
Edited on
12-04-2025
12:35 AM
By
Anthony_E
Description
Solution
config firewall local-in-policy
edit 1
set intf "port3"
set srcaddr "PING-ALLOWED"
set dstaddr "IP-WAN1"
set action accept
set service "ALL_ICMP"
set schedule "always"
next
edit 10
set intf "port3"
set srcaddr "all"
set dstaddr "all"
set action deny
set service "ALL_ICMP"
set schedule "always"
next
end
Alternatively, a single local-in policy rule can also be created by using the 'Negate' option, and will perform the same task.
Here is the configuration when using srcaddr-negate enable option.
config firewall local-in-policy
edit 0
set intf "port3"
set srcaddr "PING-ALLOWED"
set srcaddr-negate enable <----- This command will negate the rule and will block all addresses except those defined in the 'srcaddr' field
set dstaddr "all"
set action deny
set service "ALL_ICMP"
set schedule "always"
set status enable
next
end
diagnose sniffer packet any 'host 192.168.157.80 and icmp' 4
interfaces=[any]
filters=[host 192.168.157.80 and icmp]
17.815713 port3 in 192.168.157.80 -> 192.168.157.77: icmp: echo request
17.815858 port3 out 192.168.157.77 -> 192.168.157.80: icmp: echo reply
18.822895 port3 in 192.168.157.80 -> 192.168.157.77: icmp: echo request
18.822955 port3 out 192.168.157.77 -> 192.168.157.80: icmp: echo reply
19.831082 port3 in 192.168.157.80 -> 192.168.157.77: icmp: echo request
19.831150 port3 out 192.168.157.77 -> 192.168.157.80: icmp: echo reply
48.692297 port3 in 192.168.157.80 -> 192.168.157.77: icmp: echo request
48.692368 port3 out 192.168.157.77 -> 192.168.157.80: icmp: echo reply
diagnose sniffer packet any 'icmp' 4
interfaces=[any]
filters=[icmp]
17.806037 port3 in 192.168.157.207 -> 192.168.157.77: icmp: echo request
20.586094 port3 in 208.91.112.53 -> 192.168.157.77: icmp: 208.91.112.53 udp port 53 unreachable
22.353097 port3 in 192.168.157.207 -> 192.168.157.77: icmp: echo request
Related document:
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.