How to Create a Windows Firewall Rule for Traceroute

Abstract: Resolve Windows Firewall blocking traceroute by allowing inbound ICMP Type 3, Type 11, and UDP high port traffic.

Created: 2026-09-15 by
To allow traceroute diagnostics on Windows, you must create inbound firewall rules that permit Internet Control Message Protocol (ICMP) Type 3 messages and User Datagram Protocol (UDP) traffic on high ports. The standard tracert command relies on these specific protocols to map network paths. Without explicit rules, the Windows Defender Firewall often blocks the necessary return packets, causing the command to appear hung or fail entirely during network troubleshooting sessions.

Understanding Traceroute Protocols

Before configuring the firewall, it is essential to understand which protocols the tracert utility utilizes. By default, Windows uses ICMP Echo Request messages with incrementing Time-To-Live (TTL) values. Each router along the path decrements the TTL; when it reaches zero, the router sends back an ICMP Type 11 (Time Exceeded) message. Additionally, if the destination is reached, an ICMP Type 0 (Echo Reply) is returned. However, some versions of traceroute or alternative tools may use UDP packets starting at port 33434 and incrementing for each hop. Therefore, a robust rule set must account for both ICMP and UDP traffic to ensure compatibility across different network environments.

Creating an ICMP Rule via Command Line

The most efficient method to configure firewall rules is using the netsh command-line tool within an elevated Command Prompt. This approach avoids navigating through complex GUI menus and ensures the rule is applied consistently. You need administrative privileges to modify system-wide firewall settings. Open your terminal by searching for "cmd" in the Start menu, right-clicking the result, and selecting "Run as administrator." First, create a rule that allows inbound ICMP Type 3 messages. These are Destination Unreachable messages, which are critical for diagnosing why a packet failed to reach its target. Execute the following command:
netsh advfirewall firewall add rule name="Allow ICMP Type 3 Inbound" protocol=icmpv4:3,any dir=in action=allow
Next, allow ICMP Type 11 messages, which indicate that the TTL has expired at an intermediate router. This is the core mechanism traceroute uses to identify hops. Run this command to enable those responses:
netsh advfirewall firewall add rule name="Allow ICMP Type 11 Inbound" protocol=icmpv4:11,any dir=in action=allow
Finally, allow general ICMP Echo Replies if you wish to test basic connectivity alongside tracing. While not strictly required for the hop-by-hop logic, it helps verify end-to-end reachability:
netsh advfirewall firewall add rule name="Allow ICMP Echo Reply Inbound" protocol=icmpv4:8,any dir=in action=allow
If you encounter issues with other command-line utilities like Press any key to exit in command prompt, ensuring your environment variables and permissions are correct is just as vital as network configuration.

Configuring UDP Rules for Alternative Tracers

Some network administrators prefer UDP-based tracing because it can traverse certain asymmetric routing setups more effectively than ICMP. If your diagnostic tools rely on UDP, you must open the range of ports typically used by traceroute. The standard implementation starts at UDP port 33434 and increments for each hop up to 33534. Create a rule to allow inbound UDP traffic on this specific range. This ensures that when your local machine sends out probes, the return traffic from intermediate routers is not dropped by the firewall. Use the following command to define this allowance:
netsh advfirewall firewall add rule name="Allow UDP Traceroute Ports" protocol=udp dir=in action=allow localport=33434-33534
This rule specifically targets the ephemeral ports used by the traceroute process. It does not expose your entire system to random UDP scans, maintaining a reasonable security posture while enabling diagnostics. For more complex batch scripting needs, such as creating delays between diagnostic steps, you might find resources on Using 'if not exist' in batch file to create delay helpful for automating your network checks.

Verifying and Testing the Configuration

After applying the rules, verify that they have been added correctly. You can list all firewall rules containing "Traceroute" or "ICMP" to confirm their existence. Run the following command to view the details:
netsh advfirewall firewall show rule name=all | findstr /i "traceroute icmp"
Once verified, test the configuration by running a standard traceroute command against a public DNS server or a known external IP address. Open your command prompt and type:
tracert 8.8.8.8
You should see a list of hops with response times. If the trace stops abruptly after the first few hops, check your outbound firewall rules as well, although Windows typically allows outbound ICMP and UDP by default. If you experience difficulties with text processing during your diagnostics, understanding how to troubleshoot commands like Troubleshooting findstr /X Command in Windows can assist in parsing output logs efficiently.

Frequently Asked Questions

Why does my traceroute show asterisks instead of hop IPs?

Asterisks indicate that the probe timed out, usually because the firewall blocked the return ICMP or UDP packets. Ensure your inbound rules for ICMP Type 11 and UDP ports 33434-33534 are active and allowed. Some intermediate routers may also drop ICMP messages intentionally for security reasons, which is outside your local control.

Can I use PowerShell instead of netsh to create these rules?

Yes, PowerShell provides the New-NetFirewallRule cmdlet for managing firewall policies. For example, you can use New-NetFirewallRule -DisplayName "Allow ICMP Type 11" -Direction Inbound -Protocol ICMPv4 -IcmpType 11 -Action Allow. This method integrates better with modern automation scripts compared to the legacy netsh syntax.

Do I need to open outbound ports for traceroute to work?

Typically, no. Windows allows outbound ICMP and UDP traffic by default. The primary issue is usually inbound traffic being blocked. However, if you are behind a strict corporate proxy or hardware firewall, you may need to consult your network administrator regarding outbound restrictions on UDP high ports.

How do I delete these firewall rules later?

To remove the rules created in this guide, use the netsh command with the delete option followed by the rule name. For example: netsh advfirewall firewall delete rule name="Allow ICMP Type 11 Inbound". Ensure you run the command prompt as an administrator to execute deletions successfully.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More