If you are a network engineer troubleshooting a complex routing issue, or a developer trying to establish a connection to a local database server, the built-in Windows Defender Firewall is often the primary suspect when traffic is unexpectedly blocked. To isolate the problem, the fastest diagnostic step is to completely disable the firewall temporarily.
While you can click through five different menus in the Windows Security GUI to disable the firewall for Domain, Private, and Public networks individually, that is a massive waste of time. Instead, you can use the Command Prompt (running as an Administrator) to instantly drop the entire firewall architecture across all network profiles simultaneously using a single command.
Warning: Only perform this action on a trusted, secure network, and remember to re-enable the firewall immediately after your diagnostic testing is complete.
Step 1: Open an Elevated Command Prompt
Because you are manipulating core security infrastructure, a standard command prompt will deny your request. You must launch it with administrative privileges.
- Click the Start Button on your Windows 11 taskbar.
- Type
cmdinto the search bar. - Instead of pressing Enter, look at the right-hand panel and click Run as administrator.
- Click “Yes” when the User Account Control (UAC) prompt appears.
Step 2: Execute the Kill Command (Netsh)
Windows includes a powerful command-line utility called netsh (Network Shell) that allows you to configure virtually every aspect of your network stack, including the Advanced Security Firewall.
- Inside the black Command Prompt window, carefully type or paste the following exact command:
netsh advfirewall set allprofiles state off - Press Enter.
The Result (and How to Reverse It)
The command prompt will simply output the word “Ok.”
Instantly, the Windows Defender Firewall is completely disabled across your Domain, Private, and Public network profiles. All incoming and outgoing traffic is now permitted without restriction, allowing you to run your diagnostic ping tests or port scans without interference.
Crucial Final Step: Re-Enabling the Firewall
Once you have identified the networking issue, you must secure your workstation immediately. Do not leave your machine connected to the internet with the firewall off. Open the elevated Command Prompt again and type:
netsh advfirewall set allprofiles state on
Press Enter. The firewall will instantly snap back into place, restoring your primary line of defense against malicious network traffic.