To disable the firewall on Windows 11, open Windows Security, select Firewall and network protection, click the active network profile, and switch Microsoft Defender Firewall to Off. For all profiles at once, run netsh advfirewall set allprofiles state off from an administrator Command Prompt. On a Mac, go to System Settings, Network, Firewall and switch it off. Only disable a firewall temporarily, and turn it back on when you finish.
Key takeaways
- On Windows, the fastest way is Windows Security, Firewall and network protection, then switch off the active profile.
- Use netsh advfirewall set allprofiles state off or Set-NetFirewallProfile -Enabled False for all profiles at once, from an administrator window.
- Only disable a firewall temporarily for troubleshooting, never leave it off on public Wi-Fi, and always turn it back on afterward.
Sometimes a firewall blocks the very thing you are trying to test: a game, a local server, a work app, or a new device on your network. Turning the firewall off for a few minutes is a legitimate troubleshooting step — as long as you turn it back on again.
How do I disable the firewall on Windows 11?
To disable the firewall on Windows 11, open Windows Security, select Firewall and network protection, click the active network profile, and switch Microsoft Defender Firewall to Off. Approve the User Account Control prompt, and the change applies immediately.
Here are the steps in full:
- Click Start, type Windows Security, and open it. You can also go to Settings, Privacy and security, Windows Security, Firewall and network protection.
- Click Firewall and network protection.
- Click the network that says (active), usually Private network or Public network.
- Turn the Microsoft Defender Firewall switch to Off.
- Click Yes in the User Account Control prompt.
Turning it off is per network type. Windows has separate firewall settings for Domain (work networks), Private (home) and Public networks, so switching off one profile leaves the others on. You need an administrator account to change it.
How do I turn off the firewall on Windows 10?
Turning off the firewall on Windows 10 works the same way as on Windows 11, with a slightly different path to the same screen. Open Windows Security, go to Firewall and network protection, click the active profile, and switch Microsoft Defender Firewall to Off.
On Windows 10, go to Start, Settings, Update and Security, Windows Security, then click Firewall and network protection. From there, the steps are identical to Windows 11.
You can also use Control Panel on either version: open Control Panel, System and Security, Windows Defender Firewall, click Turn Windows Defender Firewall on or off on the left, select Turn off Windows Defender Firewall (not recommended) under Private and/or Public network settings, and click OK.
How do I disable the firewall with Command Prompt?
To disable the firewall for all profiles at once, open Command Prompt as administrator and run netsh advfirewall set allprofiles state off. To turn it back on, run the same command with state on.
Microsoft documents this in its guide to managing Windows Firewall with the command line, and it is the fastest way to toggle all three profiles — Domain, Private and Public — in one step. You must run it from an elevated window; a normal Command Prompt will return an access error.
- Turn off all profiles:
netsh advfirewall set allprofiles state off - Turn off one profile:
netsh advfirewall set privateprofile state off(or domainprofile, or publicprofile) - Turn it back on:
netsh advfirewall set allprofiles state on - Check the status:
netsh advfirewall show allprofiles
Microsoft recommends that you do not disable Windows Firewall by stopping the Windows Firewall service (MpsSvc). Stopping the service is not supported and can cause problems, including losing IPsec connection security rules and boot-time filters. The proper method is to disable the firewall profiles and leave the service running.
How do I disable the firewall in PowerShell?
PowerShell gives you the same control in a script-friendly form. Open PowerShell as administrator and run Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False to turn the firewall off for all profiles.
The Set-NetFirewallProfile cmdlet configures settings that apply to the per-profile configurations of Windows Firewall with Advanced Security, including Domain, Public and Private profiles. To turn the firewall back on, run the same command with -Enabled True.
Check the current state first with Get-NetFirewallProfile | Format-Table Name, Enabled. That shows you which profiles are on and which are off, so you know exactly what you changed and can restore it afterward.
How do I turn off the firewall on a Mac?
On macOS Ventura and later, open System Settings, click Network in the sidebar, click Firewall, and turn the Firewall switch off. Enter your administrator password or use Touch ID if asked.
On macOS Monterey and earlier, the path is different: open System Preferences, click Security and Privacy, select the Firewall tab, click the padlock and enter your password, then click Turn Off Firewall.
From Terminal, administrators can use the socketfilterfw utility: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off turns it off, and --setglobalstate on turns it back on. Check the state with --getglobalstate. The macOS firewall blocks unsolicited incoming connections while letting approved apps communicate, so turning it off removes that filter entirely.
How do I disable the firewall with Group Policy?
On a work computer, IT administrators can disable the firewall for a whole domain with Group Policy. The setting is under Computer Configuration, Administrative Templates, Network, Network Connections, Windows Firewall, then the Domain, Private or Public profile, "Windows Firewall: Protect all network connections".
If the firewall switches are greyed out on your PC, or you see a message that settings are managed by your administrator, a Group Policy is controlling the firewall and you cannot change it yourself. Ask your IT administrator, and do not try to work around it by stopping the service — Microsoft says that is unsupported and can break other protections.
Which method should you use to disable the firewall?
Each method below reaches the same result, but they differ in speed and scope. Windows Security is best for one profile, Command Prompt and PowerShell are best for all profiles at once, and Group Policy is for IT administrators managing many PCs.
| Method | Scope | Speed | Best for |
|---|---|---|---|
| Windows Security | One profile | Fast | Most users, one network |
| Control Panel | Private and Public | Medium | Windows 10 users |
| Command Prompt (netsh) | All profiles | Fast | Quick toggle, scripts |
| PowerShell | All profiles | Fast | Admins, automation |
| Group Policy | Whole domain | Slow | IT administrators |
| macOS System Settings | Whole Mac | Fast | Mac users |
What is the safer alternative to turning the firewall off?
The safer alternative is to allow one app through the firewall instead of turning the whole firewall off. That fixes most app problems without removing all protection.
On Windows, go to Windows Security, Firewall and network protection, click Allow an app through firewall, click Change settings, check the app, and check Private and/or Public as needed. On a Mac, go to the Firewall settings, click Options, and add the app to the allowed list.
Other safer steps to try first: check that the app is up to date, restart your router and PC, and test with a different network. If the problem only happens on one network, the issue may be the router's firewall, not your PC's.
What happens when you disable the firewall?
When you disable the firewall, your device stops filtering inbound connections. Other devices on the same network can reach services on your PC that the firewall would normally block, and network fingerprinting attacks become easier.
Microsoft notes that disabling Windows Firewall also loses other benefits, such as IPsec connection security rules, network protection from attacks that use network fingerprinting, Windows Service Hardening and boot-time filters. That is why Microsoft recommends against disabling it, and why a temporary disable for troubleshooting should be just that — temporary.
If you use a third-party security suite, it may have its own firewall. Turning off Windows Defender Firewall while the suite's firewall is on is normal, but turning off both leaves you with no firewall at all.
What if turning the firewall off does not fix the problem?
If turning the firewall off does not fix the problem, turn it back on and look elsewhere. The cause is often the router, the app's own settings, or a VPN.
- Check the router: restart it, and check whether its firewall or parental controls block the app.
- Check the app: make sure it is allowed through the firewall and up to date, and try running it as administrator.
- Check the VPN: disconnect it and test again, since VPNs can block local connections.
- Check the network profile: if you are on a Public network, Windows applies stricter rules than on a Private network.
- Reset the firewall: run
netsh advfirewall resetfrom an administrator Command Prompt to restore defaults — but note that it removes rules you created.
The bottom line
Disabling a firewall is a troubleshooting tool, not a setting to leave off. On Windows, use Windows Security for one profile or netsh and PowerShell for all of them; on a Mac, use System Settings, Network, Firewall. Test, then turn it back on.
If an app keeps needing the firewall off, allow that one app through instead, or ask your IT team why it is blocked. You can check what your own network exposes from the outside with our free IP checker.
Our guide to securing your Wi-Fi covers the network side of the same problem.
Our small business checklist covers firewall basics alongside the other controls that matter.
Frequently asked questions
How do I turn off the firewall in Windows 11?
Open Windows Security, select Firewall and network protection, click the active network profile, and switch Microsoft Defender Firewall to Off. Approve the User Account Control prompt. The change applies immediately with no restart.
How do I disable the firewall with Command Prompt?
Open Command Prompt as administrator and run netsh advfirewall set allprofiles state off. To turn it back on, run netsh advfirewall set allprofiles state on. Check the status with netsh advfirewall show allprofiles.
How do I turn off the firewall in PowerShell?
Open PowerShell as administrator and run Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False. To turn it back on, run the same command with -Enabled True.
How do I turn off the firewall on a Mac?
On macOS Ventura and later, open System Settings, click Network, click Firewall, and turn the Firewall switch off. On Monterey and earlier, open System Preferences, Security and Privacy, Firewall, and click Turn Off Firewall.
Is it safe to disable the firewall?
Only briefly, on a trusted network, for troubleshooting. While it is off, nothing filters inbound connections to your device. Never leave it off on public Wi-Fi, and turn it back on as soon as you finish testing.
Why is my firewall setting greyed out?
If the switches are greyed out, or you see a message that settings are managed by your administrator, a work policy or Group Policy is controlling the firewall. You will need your IT administrator to change it.
What is the safer alternative to turning the firewall off?
Allow one app through the firewall instead. In Windows Security, Firewall and network protection, click Allow an app through firewall, and check the app and the network types it needs. That fixes most app problems without removing all protection.
How do I turn the firewall back on?
In Windows Security, Firewall and network protection, click Turn on next to any network that is off, or run netsh advfirewall set allprofiles state on from an administrator Command Prompt. On a Mac, return to System Settings, Network, Firewall and switch it back on.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against Microsoft Learn documentation for Windows Firewall command-line and PowerShell management.
How we write and fact-check →