How to Turn On or Off Microsoft Defender Firewall in Windows 11
Microsoft Defender Firewall in Windows 11 blocks unwanted network traffic and protects your PC from online threats using built-in security rules. Windows 11 turns on this security feature automatically by default, but you can turn it off whenever you need to fix network problems or install special software.
You need administrator rights on your PC to change these security settings. Turning off the firewall temporarily lets you test network connections or run programs that the security system blocks, but you should turn it back on right after to keep your computer safe.
Open Windows Security, navigate to Firewall & network protection, select your network type, and toggle Microsoft Defender Firewall on or off. Alternatively, use Control Panel , Command Prompt, or PowerShell for adjustments.
Turn On or Off Microsoft Defender Firewall Using Windows Security
- Click the Start button and open Windows Security. You can type “Windows Security” in the search box.
- In Windows Security, click on Firewall & network protection.
- Choose the network type you want to change (Domain, Private, or Public). You’ll see which one is active next to it.
- Turn the switch On or Off for Microsoft Defender Firewall.
- If a confirmation box appears (User Account Control), click Yes.
- Close Windows Security when you’re done.

You can turn on or off Microsoft Defender Firewall using Windows Security by opening the app, clicking Firewall & network protection, selecting your network type, and changing the switch. This method is the fastest way to manage your Windows 11 Defender Firewall without digging through older system settings menus.


Turn On or Off Microsoft Defender Firewall Using Control Panel
- Open the Control Panel . (Press Win+R, type
control, and press Enter.) - Click on Windows Defender Firewall.
- On the left side, click Turn Windows Defender Firewall on or off.
- Choose to turn the firewall On or Off for Domain, Private, and Public networks.
- Click OK to save your changes.
- Close Control Panel if you want.

You can turn on or off Microsoft Defender Firewall using Control Panel by opening the classic utility, clicking Windows Defender Firewall, and choosing the turn on or off link on the left side. This approach lets you manage your Windows 11 Defender Firewall across domain, private, and public networks all in one place.

Turn On or Off Microsoft Defender Firewall Using Command Prompt
You can turn on or off Microsoft Defender Firewall using Command Prompt by launching the terminal with administrator rights and running specific networking commands. This method helps you configure your Windows 11 Defender Firewall quickly if you prefer typing commands instead of clicking through graphical menus.
- Open Windows Terminal (Admin):
- Right-click the Start button and choose Windows Terminal (Admin).
- When it opens, click the down arrow (˅) and select Command Prompt.
- Type or paste one of the commands below, then press Enter:
Enable Firewall for All Networks (Domain, Private, Public)
netsh advfirewall set allprofiles state on
Disable Firewall for All Networks
netsh advfirewall set allprofiles state off
Enable Firewall for Current (Active) Network
netsh advfirewall set currentprofile state on
Disable Firewall for Current (Active) Network
netsh advfirewall set currentprofile state off
Enable Firewall for Specific Network Type
- Domain:
netsh advfirewall set domainprofile state on - Private:
netsh advfirewall set privateprofile state on - Public:
netsh advfirewall set publicprofile state on
Disable Firewall for Specific Network Type
- Domain:
netsh advfirewall set domainprofile state off - Private:
netsh advfirewall set privateprofile state off - Public:
netsh advfirewall set publicprofile state off
Close Windows Terminal after executing the commands.
Turn On or Off Microsoft Defender Firewall Using PowerShell
You can turn on or off Microsoft Defender Firewall using PowerShell by opening the command-line tool with administrator privileges and executing dedicated networking cmdlets. This option gives you direct control over your Windows 11 Defender Firewall settings and works well for automating security tasks on your computer.
- Open Windows Terminal (Admin) and select Windows PowerShell.
- Type or paste the commands below, then press Enter:
Enable Firewall for All Network Profiles
Set-NetFirewallProfile -All -Enabled True
Disable Firewall for All Network Profiles
Set-NetFirewallProfile -All -Enabled False
Enable Firewall for Specific Network Profile
- Domain:
Set-NetFirewallProfile -Profile Domain -Enabled True - Private:
Set-NetFirewallProfile -Profile Private -Enabled True - Public:
Set-NetFirewallProfile -Profile Public -Enabled True
Disable Firewall for Specific Network Profile
- Domain:
Set-NetFirewallProfile -Profile Domain -Enabled False - Private:
Set-NetFirewallProfile -Profile Private -Enabled False - Public:
Set-NetFirewallProfile -Profile Public -Enabled False
Close Windows Terminal upon completion.
Summary
- Why use the Firewall? It stops hackers and harmful software from reaching your PC.
- Easy to Use: You can turn it on or off through Windows Security, Control Panel, Command Prompt, or PowerShell.
- Different Networks: Firewall settings can be different for your home, work, or public Wi-Fi.
- Admin Rights Needed: Only users with admin access can change firewall settings.
- Stay Protected: It's best to keep the firewall turned on for your safety.
Microsoft Defender Firewall protects your PC from unauthorized access by blocking harmful network traffic, and you can easily control these settings using Windows Security, Control Panel, Command Prompt, or PowerShell. Managing your Windows 11 Defender Firewall correctly ensures your computer stays secure on both home networks and public Wi-Fi hotspots.
Is the Windows Defender Firewall included in 🪟 Windows 11?
Windows 11 devices feature Windows Security, incorporating Microsoft Defender Antivirus to protect systems from viruses and malware.
How to enable Windows Defender Firewall in 🪟 Windows 11?
The Control Panel appears on the right side here. Clicking either option opens a small dialogue box.
Does Microsoft Defender have a built-in firewall?
Windows Defender Firewall is built-in Windows software that controls network traffic permitted or blocked from passing to or from the computer across a network. Windows Defender Firewall remains enabled by default.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!