Enable – Disable Firewall in Windows Server 2012

I can tell that I am not experienced at all with Windows Server Operating System. The last year I had some experience with Windows Server 2003, 2008 and 2012 but that was for some little projects, and I have not in depth knowledge. Today I tried to turn off firewall on windows server 2012. The metro style got me on firewall rules when I typed firewall on search. Then the first thing I though as a linux admin was to stop the service and not keep searching for firewall turn off feature, I saw sometimes here and there.

I can tell that I am not experienced at all with Windows Server Operating System. The last year I had some experience with Windows Server 2003, 2008 and 2012 but that was for some little projects, and I have not in depth knowledge. Today I tried to turn off firewall on windows server 2012. The metro style got me on firewall rules when I typed firewall on search. Then the first thing I though as a linux admin was to stop the service and not keep searching for firewall turn off feature, I saw sometimes here and there.

I stopped the service and Ooops the Remote Desktop Connection was broken. I thought it might needs some time to reinitialize network interfaces. Waiting for a ping response from the server, I googled about that incident and I found a great powershell command to turn off and on the firewall:

netsh advfirewall set allprofiles state off
 netsh advfirewall set allprofiles state on

I posted this command just to remember that there is a simple way to just do it, even in Windows. 🙂

 

Now it’s time to describe the other way ( the gui one ) for Windows lovers:

Go to Control Panel -> System and Security -> Windows Firewall

windows-server-2012-enable-disable-firewall

Click on the left sidebar the link:

Turn Windows Firewall on or off

and then select for each level to turn it on or off.

windows-server-2012-enable-disable-firewall-2

 

The last thing I want to to say, either you are getting dirty hands on linux or windows, do not turn off firewall. You can disable it for a while or for testing purposes, but if you want to stay secure ( as secure as you can ) do not turn it off.