| Description | This article describes how to configure custom ICMPv6 services on FortiGate to allow specific ICMPv6 types and codes while blocking others, and how to trigger IPv6 traffic to verify using Scapy. |
| Scope | FortiGate. |
| Solution |
In this scenario, FortiGate is configured to allow only ICMPv6 Type 128 Code 0. This is an ICMPv6 Echo Request. And to block any other Code number.
Topology :
FGT-A (port2) -- (port1)FGT-B(port2) -- Windows Machine.
Configuration on FGT-B:
config firewall service custom
config firewall policy
To trigger IPv6 traffic from a Windows Machine, tools Scapy tool can be used.
Scapy command to send ICMPv6 Echo Request:
send(IPv6(dst="fd01:af0:8003:2::af",src="fd01:af0:8005:2:45c3:2a0b:f009:521")/ICMPv6EchoRequest(type=128, code=0))
Packet Capture :
FGT-B:
2123.955444 port2 in fd01:af0:8005:2:45c3:2a0b:f009:521 -> fd01:af0:8003:2::af: icmp6: echo request seq 0
FGT-A:
2149.961050 port2 in fd01:af0:8005:2:45c3:2a0b:f009:521 -> fd01:af0:8003:2::af: icmp6: echo request seq 0
When using different ICMPv6 Code:
send(IPv6(dst="fd01:af0:8003:2::af",src="fd01:af0:8005:2:45c3:2a0b:f009:521")/ICMPv6EchoRequest(type=128, code=1))
Packet Capture FGT-B:
2248.332626 port2 in fd01:af0:8005:2:45c3:2a0b:f009:521 -> fd01:af0:8003:2::af: icmp6: echo request seq 0
Debug Flow FGT-B:
id=65308 trace_id=115 func=resolve_ip6_tuple_fast line=5315 msg="vd-root:0 received a packet(proto=58, fd01:af0:8005:2:45c3:2a0b:f009:521:0->fd01:af0:8003:2::af:384) from port2. type=128, code=1, id=0, seq=0."
Logs FGT-B:
date=2025-08-03 time=17:03:08 eventtime=1754265788133226307 tz="-0700" logid="0000000013" type="traffic" subtype="forward" level="notice" vd="root" srcip=fd01:af0:8005:2:45c3:2a0b:f009:521 identifier=0 srcintf="port2" srcintfrole="undefined" dstip=fd01:af0:8003:2::af dstintf="port1" dstintfrole="undefined" sessionid=88374 proto=58 action="deny" policyid=3 policytype="policy" poluuid="8561b662-6c3d-51f0-ea93-81723869cdea" policyname="icmpv6" service="PING6" trandisp="noop" appcat="unscanned" duration=0 sentbyte=0 rcvdbyte=0 sentpkt=0 rcvdpkt=0 crscore=30 craction=131072 crlevel="high"
More options about IPv6 packets using Scapy : |
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.