Technical Tip: Traffic is not getting blocked even after adding Ban IP
| Description | This article describes the traffic handled by FortiGate when a Ban IP is added. |
| Scope | FortiGate. |
| Solution | The IP ban feature enforces access control by blacklisting specified source IP addresses, thereby dropping all associated traffic at the firewall.
Upon banning an IP address, the system forcibly terminates all active sessions associated with that source, ensuring the immediate termination of ongoing connections.
Even after banning the IP, SSH/HTTPS/PING to FortiGate’s interface still works. It is because IP ban evaluation is performed only when traffic matches a firewall policy configured with an ACCEPT action.
If the source address is on the ban list, the effective action is overridden to DENY. It applies only to the traffic meant to pass through from the FortiGate (Forwarding Traffic) and it does not work for Local-In traffic. For example, the Kernel Banned IP feature cannot work when using the Virtual IP of the FortiGate as a Destination interface. There is only one complex scenario with a FortiGate using VDOM_A and VDOM_B in which the destination is a Loopback in VDOM_B and npu-vlink is used for the intercommunication between the VDOMs.
In the example below, 10.32.22.43 is added to the Ban IP by the Admin.
To add an IP Address to the ban list:
To view the banned IP list: kaon-kvm42 # diagnose user banned-ip list
Debug Ssample of traffic blocked due to the ban IP:
kaon-kvm42 # id=65308 trace_id=16 func=print_pkt_detail line=6194 msg="vd-root:0 received a packet(proto=6, 10.32.22.43:15498->10.5.141.231:4433) tun_id=0.0.0.0 from port1. flag [S], seq 3414889184, ack 0, win 64240"
Debug sample of PING to FortiGate's interface with the same ban IP:
kaon-kvm42 # id=65308 trace_id=26 func=print_pkt_detail line=6194 msg="vd-root:0 received a packet(proto=1, 10.32.22.43:1->10.5.141.231:2048) tun_id=0.0.0.0 from port1. type=8, code=0, id=1, seq=16."
The above debug shows reply packets from the FortiGate for ICMP. |
