------------------------
Enable by port & exe
------------------------
Sample old
------------------------
netsh firewall add portopening TCP 80 “HTTP”netsh firewall add portopening TCP 23 “Telnet”netsh firewall add allowedprogram C:\MyApp\MyApp.exe "My Application" ENABLE
------------------------
Sample new server 2008
------------------------
netsh advfirewall firewall add rule name=”HTTP” dir=in action=allow protocol=TCP localport=80netsh advfirewall firewall add rule name=”My Application” dir=in action=allow program=”C:\MyApp\MyApp.exe” enable=yes
------------------------
Disable by port & exe
------------------------
Sample old
------------------------
netsh firewall delete allowedprogram C:\MyApp\MyApp.exedelete portopening protocol=UDP port=500
------------------------
Sample new server 2008
------------------------
netsh advfirewall firewall delete rule name=rule name program=”C:\MyApp\MyApp.exe”netsh advfirewall firewall delete rule name=rule name protocol=udp localport=500
Restore policy defaults
netsh firewall resetnetsh advfirewall reset
Enable Windows Firewall
netsh firewall set opmode ENABLEnetsh firewall set opmode DISABLE
No comments:
Post a Comment