Skip to content
Follow
Windows

How to Turn On or Off Microsoft Defender Firewall in Windows 11

Richard
Written by
Richard
Mar 14, 2026 Updated Aug 13, 2026 5 min read
How to Turn On or Off Microsoft Defender Firewall in Windows 11
How to Turn On or Off Microsoft Defender Firewall in Windows 11

Microsoft Defender Firewall in Windows 11 acts as a built-in security guard that blocks unwanted network traffic and protects your PC from online threats. 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.

⚡ Quick Answer

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

  1. Click the Start button and open Windows Security. You can type “Windows Security” in the search box.
  2. In Windows Security, click on Firewall & network protection.
  3. Choose the network type you want to change (Domain, Private, or Public). You’ll see which one is active next to it.
  4. Turn the switch On or Off for Microsoft Defender Firewall.
  5. If a confirmation box appears (User Account Control), click Yes.
  6. Close Windows Security when you’re done.
Windows Security app Firewall and network protection section
Windows 11 Security app showing Firewall and network protection section.

Managing the Windows 11 Defender Firewall through Windows Security begins by launching the app. Navigate to Firewall & network protection, select the active network type, and adjust the toggle switch.

Firewall and network protection settings for private network
Firewall and network protection settings for private network

Managing the Windows 11 Defender Firewall through Windows Security begins by launching the app. Navigate to Firewall & network protection, select the active network type, and adjust the toggle switch.

Microsoft Defender Firewall toggle switch for private network
Microsoft Defender Firewall toggle switch for private network

Managing the Windows 11 Defender Firewall through Windows Security begins by launching the app. Navigate to Firewall & network protection, select the active network type, and adjust the toggle switch.

Turn On or Off Microsoft Defender Firewall Using Control Panel

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

Open the Control Panel by pressing Win+R, typing control, and hitting Enter to manage the Windows 11 Defender Firewall. Click Windows Defender Firewall next, then select Turn Windows Defender Firewall on or off from the left-hand menu. Active profiles display an indicator right beside their name. Toggle the switch to enable or disable Microsoft Defender Firewall across various network types.

Control Panel firewall configuration options and settings menu
Control Panel firewall configuration options and settings menu

Open the Control Panel by pressing Windows + R, typing control, and hitting Enter to manage the Windows 11 Defender Firewall. Click Windows Defender Firewall next, then select Turn Windows Defender Firewall on or off from the left-hand menu. Active profiles display an indicator right beside their name. Toggle the switch to enable or disable Microsoft Defender Firewall across various network types.

Turn On or Off Microsoft Defender Firewall Using Command Prompt

Command Prompt offers granular control over the Windows 11 Defender Firewall for advanced workflows. Launch Command Prompt with administrative privileges by right-clicking the Start button and selecting Windows Terminal (Admin). Specific commands then execute to enable or disable the firewall for targeted networks.

  1. 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.
  2. Type or paste one of the commands below, then press Enter:

Enable Firewall for All Networks (Domain, Private, Public)

💻Code
netsh advfirewall set allprofiles state on

Disable Firewall for All Networks

💻Code
netsh advfirewall set allprofiles state off

Enable Firewall for Current (Active) Network

💻Code
netsh advfirewall set currentprofile state on

Disable Firewall for Current (Active) Network

💻Code
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

PowerShell provides advanced control and automation capabilities for the Windows 11 Defender Firewall. Open Windows Terminal (Admin) and select Windows PowerShell. Specific commands then execute to enable or disable the firewall across all network profiles.

  1. Open Windows Terminal (Admin) and select Windows PowerShell.
  2. Type or paste the commands below, then press Enter:

Enable Firewall for All Network Profiles

PowerShell
Set-NetFirewallProfile -All -Enabled True

Disable Firewall for All Network Profiles

PowerShell
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.

The Windows 11 Defender Firewall remains essential for protecting PCs from hackers and malicious software. Management occurs via Windows Security, Control Panel, Command Prompt, or PowerShell. Configurations apply to distinct network types, though administrative access remains required for alterations.

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?

Tags: #Windows 11
Was this helpful?
Richard

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.

📚 Related Tutorials

Enable or Disable Microsoft Defender PUA Protection in Windows 11
Windows Enable or Disable Microsoft Defender PUA Protection in Windows 11
How to Activate Microsoft Defender Antivirus in Windows 11
Windows How to Activate Microsoft Defender Antivirus in Windows 11
How to Open Windows Terminal as Admin Automatically
Windows How to Open Windows Terminal as Admin Automatically
How to Turn On or Off Cloud Protection for Microsoft Defender Antivirus in Windows 11
Windows How to Turn On or Off Cloud Protection for Microsoft Defender Antivirus in Windows 11

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *