Windows Firewall Blocking IIS FTP Connection

Abstract: Resolve Windows Firewall blocking IIS FTP connections by enabling the FTP Traffic In TCP rule and configuring passive port ranges.

Created: 2026-10-09 by
The Windows Firewall blocks IIS FTP connections when inbound rules for the FTP service are missing, disabled, or misconfigured. To resolve this, you must enable the built-in firewall rule for FTP Traffic In (TCP) in Windows Defender Firewall with Advanced Security. This action allows standard control connections on port 21 and data connections depending on whether active or passive mode is used.

Understanding FTP Connection Modes

Before adjusting firewall settings, it is crucial to understand how FTP handles network traffic because the firewall requirements differ significantly between Active and Passive modes. FTP uses two separate channels: a control channel for commands and a data channel for file transfers. The control channel always connects from the client to the server on port 21. The data channel behavior changes based on the mode selected in your IIS configuration. In Active Mode, the server initiates the data connection back to the client. The client sends a PORT command indicating its IP address and a high-numbered ephemeral port. The server then attempts to connect from port 20 to that specific client port. While this seems straightforward, many modern clients sit behind NAT routers that drop these incoming connections from the internet, making Active Mode unreliable for external users. In Passive Mode (PASV), the client initiates both connections. After establishing the control connection, the client sends a PASV command. The server responds with an IP address and a range of high-numbered ports available for data transfer. The client then connects to one of those ports. This requires the firewall to allow inbound traffic to a wide range of dynamic ports, which is often where configuration errors occur. If you have previously configured passive ports in IIS, you must ensure the firewall permits traffic to that specific range.

Enabling the Default FTP Firewall Rule

Windows Server includes a predefined firewall rule specifically designed to handle FTP traffic. By default, this rule may be disabled or not applied to the correct network profile (Private, Public, or Domain). You need to verify and enable this rule manually through the graphical interface or PowerShell. Open the Administrative Tools menu and launch Windows Defender Firewall with Advanced Security. Navigate to the Inbound Rules section in the left pane. Scroll down the list and locate the rule named FTP Traffic In (TCP-In). You can identify it by checking the description or the program path, which typically points to %SystemRoot%\system32\ftpsvc.dll. Right-click the rule and select Properties. Ensure that the rule is set to Enabled. Check the Scope tab to verify that it applies to the IP addresses relevant to your setup. For most internal servers, leaving it as Any is acceptable, but if you have strict security policies, you may restrict it to specific subnets. Finally, check the Action tab to confirm it is set to Allow the connection. If you prefer using PowerShell, you can enable the rule with a single command. Run the following command in an elevated PowerShell session:
Enable-NetFirewallRule -DisplayName "FTP Traffic In (TCP-In)"
This command automatically enables the rule across all network profiles. If the rule does not exist, it indicates that the FTP Service feature was not installed correctly or the firewall components were not registered properly during installation.

Configuring Passive Port Ranges

When using Passive Mode, the firewall rule for FTP Traffic In alone is insufficient because it only covers the control port. You must also create additional inbound rules to allow the dynamic data ports. IIS allows you to configure a specific range of ports for passive connections to limit the exposure surface area. First, open IIS Manager and select the server node in the left connection pane. Double-click FTP Firewall Support under the FTP section in the middle pane. In the Passive Port Range field, enter a small, manageable range such as 50000-50100. Avoid large ranges like thousands of ports, as they increase attack vectors and complicate firewall management. Note the External IP Address field; if your server is behind a NAT gateway, this must match the public IP address assigned to your router, not the local private IP. Once you have defined the port range, return to Windows Defender Firewall with Advanced Security. Create a new inbound rule by selecting New Rule under Inbound Rules. Choose Port as the rule type and select TCP. Enter the specific port range you configured in IIS (e.g., 50000-50100). Proceed through the wizard, setting the action to Allow the connection and applying it to all profiles. Name the rule clearly, such as IIS FTP Passive Data Ports. This step ensures that the firewall explicitly permits the data connections initiated by clients in passive mode. Without this rule, clients will hang indefinitely when trying to list directories or upload files, even though the initial login succeeds.

Verifying Connectivity and Troubleshooting

After enabling the firewall rules and configuring passive ports, test the connection using an FTP client. Use a tool like FileZilla or the command-line ftp utility. Attempt to connect to the server on port 21. If the connection drops after authentication, the issue is likely related to the data channel. Check the Windows Event Viewer for any firewall-related warnings. Navigate to Applications and Services Logs > Microsoft > Windows > Firewall > Diagnostics. Look for events indicating blocked packets on the passive port range. If you see blocked events, re-verify that the inbound rule matches the exact port range defined in IIS. Additionally, ensure that the FTP Publishing Service is running. Open Services.msc and verify that FTP Publishing Service is set to Automatic startup and is currently Running. If the service is stopped, no firewall rules will effectively manage traffic because the application handling the protocol is inactive. For further assistance with IIS connectivity issues, refer to our guide on Configuring IIS FTP Server on Windows to Allow Remote User File Downloads with Another Local Program, which details advanced user permission setups. If you encounter broader network reachability problems unrelated to FTP ports, check Unblocking Port 80443 for IIS Web Server for general troubleshooting patterns.

Frequently Asked Questions

Why does my FTP login succeed but directory listing fail?

This symptom almost always indicates a firewall block on the data channel rather than the control channel. In passive mode, the client connects to a dynamic port for listing files, so you must ensure your firewall allows inbound traffic to the passive port range configured in IIS.

Can I use Active Mode instead of Passive Mode?

Yes, but Active Mode is generally discouraged for internet-facing servers because it requires the server to initiate connections back to the client. Most modern firewalls and NAT devices block these incoming connections from the server, causing timeouts unless you have full visibility into the client's network configuration.

What happens if I leave the Passive Port Range empty?

If you leave the range empty in IIS, the system defaults to a very large range of ephemeral ports (typically 49152-65535). Configuring a smaller, explicit range is recommended to simplify firewall rules and reduce the number of open ports exposed to potential attackers.

How do I reset the FTP Firewall rule if I accidentally deleted it?

You can restore the default rule by reinstalling the FTP Server feature via Server Manager. Alternatively, export the default firewall configuration from a clean server or recreate the rule manually with the same display name and parameters as the original system-generated rule.

Does enabling the FTP rule affect HTTPS or HTTP traffic?

No, the FTP firewall rule is specific to TCP port 21 and the designated passive data ports. It does not interfere with web traffic on ports 80 or 443, which are managed by separate firewall rules for IIS Web Server.

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