Over the years, protection has become increasingly more and more difficult to avoid. It is everywhere, we have high end firewalls to let you, we have high end firewalls to let you out, we have firewalls within firewalls to protect other firewalls, and we also have firewalls on the servers themselves. Sometimes you spend hours trying to figure out why something is not communicating to something else, and it turns out the good old Windows Firewall is causing your problem. On the Unix Systems you may encounter firewall rules via the iptables security configuration, but that is another story.
A few weeks ago, while troubleshooting a connection issue, I found an article: Top 10: Windows Firewall netsh commands and I was very pleased that I had. If you ever try to work through all the rules in Windows Firewall, you will be there awhile.
netsh advfirewall set allprofiles state on netsh advfirewall set allprofiles state off
Tip #2: Query Windows Firewall
netsh advfirewall firewall show rule name=all
Tip #3: Enable/Disable Ping
Disable: netsh advfirewall firewall add rule name=”All ICMP V4″ dir=in action=block protocol=icmpv4
Enable: netsh advfirewall firewall add rule name=”All ICMP V4″ dir=in action=allow protocol=icmpv4
Tip #4: Add/Remove a Specific Port Rule (i.e. For 1521 Oracle DB)
netsh advfirewall firewall add rule name=”Open Oracle DB Port 1521″ dir=in action=allow protocol=TCP localport=1521
netsh advfirewall firewall delete rule name=”Open Oracle DB Port 1521″ protocol=tcp localport=1521
Tip #5: Enable RDC Remote Desktop Connection
netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes
Tip #6: Export/Import Firewall Settings (Same Rules – Multiple Machines)
netsh advfirewall export “C:\WFW-configuration.wfw”
netsh advfirewall import “C:\WFW-configuration.wfw”