Windows Firewall
Under Windows Server you have the built in Windows Firewall which enables you to setup firewall rules for additional protection on the server, however under Windows Firewall it is very easy to lock yourself out as well.
If you accidentally click on Block all incoming connections, including those in the list of allowed apps it will render your firewall active straight away. You will lose access to the server over RDP (Remote Desktop Protocol), it will also make your server appear offline as all connections are now blocked by the firewall.
In this situation we will need to undo the action by disabling the firewall. Servers with KVM modules included in their servers can use the KVM access to manage the server even though the server has all public connections blocked.
Servers without the KVM module will need to make use of the Win-Rescue environment where by the server boots into a basic version of Windows from the network. Under Win-Rescue you will have all the tools to get your server working normally and accepting all incoming connections.
The first step is to load up CMD-Line, from here we will load up the server registry.
reg load HKLM\Win_SYSTEM C:\windows\system32\config\system
Afterwards we can edit the registry by running the command of regedit.
The firewall setting is located at:
\HKEY_LOCAL_MACHINE\Win_SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile
In our example our path is set on ControlSet001. Its possible that you may have multiple ControlSet and it might be different values. This is dependent on your environment.
Here we can see a file called EnableFirewall The current value is 1, we will be looking to change the value into 0.
Value | Status |
---|---|
0 | Disable Firewall |
1 | Enable Firewall |
Once we have made the changes, we can unload the registry with:
reg unload HKLM\Win_SYSTEM
The last step is to reboot the server into HD mode and our server will have its firewall disabled.