Created on
‎10-04-2012
04:25 AM
Edited on
‎01-27-2025
06:02 AM
By
Stephen_G
Description
This article describes why the FortiGate answers to traceroute on the VIP addresses despite how traceroute traffic is not allowed by the firewall policies.
Scope
Firewall VIP, and traceroute.
Solution
Diagram:
Expectations, Requirements:
Some security tools report that VIP addresses 'answer' to traceroute requests, while ICMP_ANY or UDP traffics are not allowed by the firewall policies.
The traceroute tool relies on the TTL field in the IP header, which is contained in UDP packets. This TTL counter is decremented each time the packet is going through a router. While this counter is 1 or less, then the router must send an ICMP type=11, code=0 (Time Exceeded). The traceroute uses this ICMP message to figure out which host it encountered.
According to the RFC1812:
'If the TTL is reduced to zero (or less), the packet MUST be discarded, and if the destination is not a multicast address the router MUST send an ICMP Time Exceeded message, Code 0 (TTL Exceeded in Transit) message to the source.'
From the FortiGate point of view, the firewall VIP is seen as a logical IP address, and triggers a 'routing' from the 'external' address to the 'mapped' address, and then the TTL algorithm from RFC1812 is used.
There is no way to disable the sending of ICMP TTL Exceeded in Transit message, as this behavior is compliant with the RFC1812.
Configuration:
config firewall vip
edit "VIP_SERVER"
set extip 172.31.224.125
set extintf "port2"
set mappedip 10.121.2.12
next
end
config firewall policy
edit 1
set srcintf "port2"
set dstintf "VLAN121"
set srcaddr "all"
set dstaddr "VIP_SERVER"
set action accept
set schedule "always"
set service "HTTP"
next
end
Verification:
From a host connected on port2, execute 'traceroute 172.31.224.125'.
Internet Protocol Version 4, Src: 192.168.171.245 (192.168.171.245), Dst: 172.31.224.125 (172.31.224.125) Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
Total Length: 60
Identification: 0x1676 (5750)
Flags: 0x00
Fragment offset: 0
Time to live: 1
Protocol: UDP (17)
Header checksum: 0xaa00 [correct]
Source: 192.168.171.245 (192.168.171.245)
Destination: 172.31.224.125 (172.31.224.125)
User Datagram Protocol, Src Port: 37540 (37540), Dst Port: 33445 (33445)
Data (32 bytes)
0000 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f @ABCDEFGHIJKLMNO
0010 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f PQRSTUVWXYZ[\]^_
Internet Protocol Version 4, Src: 172.31.224.125 (172.31.224.125), Dst: 192.168.171.245 (192.168.171.245)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0xc0 (DSCP 0x30: Class Selector 6; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
Total Length: 88
Identification: 0xb38a (45962)
Flags: 0x00
Fragment offset: 0
Time to live: 255
Protocol: ICMP (1)
Header checksum: 0x0e1f [correct]
Source: 172.31.224.125 (172.31.224.125)
Destination: 192.168.171.245 (192.168.171.245)
Internet Control Message Protocol
Type: 11 (Time-to-live exceeded)
Code: 0 (Time to live exceeded in transit)
Checksum: 0xee74 [correct]
Internet Protocol Version 4, Src: 192.168.171.245 (192.168.171.245), Dst: 172.31.224.125 (172.31.224.125)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
Total Length: 60
Identification: 0x1676 (5750)
Flags: 0x00
Fragment offset: 0
Time to live: 1
Protocol: UDP (17)
Header checksum: 0xaa00 [correct]
Source: 192.168.171.245 (192.168.171.245)
Destination: 172.31.224.125 (172.31.224.125)
User Datagram Protocol, Src Port: 37540 (37540), Dst Port: 33445 (33445)
Data (32 bytes)
0000 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f @ABCDEFGHIJKLMNO
0010 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f PQRSTUVWXYZ[\]^_
Troubleshooting:
interfaces=[any] filters=[host 172.31.224.125 or host 10.121.2.12]
2012-10-04 09:00:49.813967 port2 in arp who-has 172.31.224.125 tell 172.31.227.254
diag debug flow filter proto 17
diag debug flow show trace start 100
d=36871 trace_id=141 msg="allocate a new session-00002467" id=36871 trace_id=141 msg="find SNAT: IP-10.121.2.12(from IPPOOL), port-33446" id=36871 trace_id=141 msg="VIP-10.121.2.12:33446, outdev-port2" id=36871 trace_id=141 msg="DNAT 172.31.224.125:33446->10.121.2.12:33446" id=36871 trace_id=141 msg="find a route: gw-10.121.2.12 via VLAN121" id=36871 trace_id=141 msg="Denied by forward policy check"