Wednesday, 15 May 2013

Messing about with NetSH AdvFirewall

Reset Firewall to Default

If you are going to mess about with your firewall the first thing you want to know is how to reset it to default

netsh advfirewall reset

Export/Import Settings

The second thing you should know is probably the last thing you would have though about. If you are going to mess around with an already successfully configured firewall then you may want to save the current settings and reimport them.

netsh advfirewall export "c:\wfconfig.wfw" 
netsh advfirewall import "c:\wfconfig.wfw"

It’s not a bad idea if you are messing about with NetSH in general to export the configuration. Not all “learning” is done with easily revertible test VMs … most of the important lesson we learn tend to be on live systems.

Firewall Off & On Test

If I switch the firewall off will this work … NO … better switch it back on then.

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

No comments:

Post a Comment