Windows Firewall (Microsoft Defender Firewall) blocks unwanted network connections to and from your PC. Occasionally you may need to turn it off briefly, for example to test whether it is blocking a game, printer, or app, or because another security product manages your firewall. In most cases, allowing a specific app through the firewall is safer than turning it off. This guide covers both, for Windows 11 and Windows 10.
Quick Answer
Open Windows Security, click Firewall & network protection, select your active network (usually Private network), and turn off Microsoft Defender Firewall. Click Yes to confirm. Turn it back on as soon as you finish testing.

Before You Turn It Off
- Try allowing the app instead (see below). It fixes most connection problems without lowering protection.
- Turn it off only on a trusted network, such as your home network, and never on public Wi-Fi.
- Remember to turn it back on. Windows will remind you, but it is easy to forget.
Network Profiles
| Profile | Used for |
|---|---|
| Domain | Work networks managed by an organization |
| Private | Trusted networks like home |
| Public | Coffee shops, airports, and other public places |
The profile marked (active) is the one currently in use. Turning off the firewall for one profile does not affect the others.
Method 1: Windows Security (Recommended)
- Click Start, type Windows Security, and open it.
- Click Firewall & network protection.
- Click the network marked (active).
- Switch Microsoft Defender Firewall to Off and click Yes on the prompt.
To turn it back on, return to the same screen and switch it On, or click Turn on on the Firewall & network protection page.
Method 2: Control Panel
- Open Control Panel > System and Security > Windows Defender Firewall.
- Click Turn Windows Defender Firewall on or off in the left pane.
- Select Turn off for the network types you want, and click OK.
Method 3: Command Line (Advanced)
In an administrator Command Prompt or Terminal:
- Turn off for all profiles:
netsh advfirewall set allprofiles state off - Turn back on:
netsh advfirewall set allprofiles state on
Safer Alternative: Allow an App Through the Firewall
- In Firewall & network protection, click Allow an app through firewall.
- Click Change settings.
- Find the app and check Private (and Public only if needed). If it is not listed, click Allow another app and browse to it.
- Click OK.
If You Use Another Security Product
Some third-party security suites include their own firewall and may turn off Windows Firewall automatically. In that case, manage the firewall from that product. Do not run with no firewall at all.
Troubleshooting
The toggle is grayed out
Your organization may manage it through policy, or another security app controls the firewall.
Turning off the firewall did not fix my problem
The issue is probably elsewhere, such as router settings, antivirus web protection, or the app itself. Turn the firewall back on.
Reset to defaults
Click Restore firewalls to default if you changed many rules and things stopped working.
Frequently Asked Questions
Is it safe to turn off Windows Firewall?
Briefly, on a trusted network, for troubleshooting. Leaving it off increases risk.
Does turning off the firewall turn off antivirus?
No. Microsoft Defender Antivirus is separate and stays on.
How do I know if the firewall is on?
Each profile on the Firewall & network protection page says Firewall is on or off.
Summary
- Try Allow an app through firewall first.
- To turn it off, open Windows Security > Firewall & network protection, choose the active network, and switch it off.
- Use Control Panel or netsh as alternatives.
- Turn the firewall back on when finished.

Kermit Matthews is a freelance writer based in Philadelphia, Pennsylvania with more than a decade of experience writing technology guides. He has a Bachelor’s and Master’s degree in Computer Science and has spent much of his professional career in IT management.
He specializes in writing content about iPhones, Android devices, Microsoft Office, and many other popular applications and devices.