netsh firewall 대신에 netsh advfirewall firewall 명령어

1 2018.03.09 14:44:12

1.     프로그램 허용

 

a.     netsh advfirewall firewall add rule name=”My Application” dir=in action=allow program=”C:\MyApp\MyApp.exe” enable=yes

 

b.     netsh advfirewall firewall add rule name=”My Application” dir=in action=allow program=”C:\MyApp\Myapp.exe” enable=yes remoteip=157.60.0.1, 172.16.0.0/16,LocalSubnet profile=domain

 

2.     포트 허용

 

a.     netsh advfirewall firewall add rule name=”Open Port 80” dir=in action=allow protocol=TCP localport=80

 

3.     허용된 프로그램과 포트 룰 제거 하기

 

a.     netsh advfirewall firewall delete rule name=”rulename” program=”C:\MyApp\MyApp.exe”

 

b.     netsh advfirewall firewall delete rule name=”rulename” protocol=udp localport=500

 

4.     ICMP 설정 하기

 

a.     netsh advfirewall  firewall add rule name=”ICMP Allow incoming V4 echo request” protocol=icmpv4:8,any dir=in action=allow

 

b.     netsh advfirewall firewall add rule name=”All  ICMP V4” protocol=icmpv4:any,any dir=in action=allow

 

 

5.     로깅 설정

 

a.     netsh advfirewall set currentprofile logging filename %systemroot%\system32\LogFiles\Filewall\pfirewall.log

 

b.     netsh advfirewall set currentprofile logging maxfilesize 4096

 

c.     netsh advfirewall set currentprofile logging droppedconnections enable

 

d.     netsh advfirewall set currentprofile logging allowedconnections enable

 

 

 

6.     방화벽 On/Off

 

a.     netsh advfirewall set currentprofile state on

 

b.     netsh advfirewall set currentprofile state on
netsh advfirewall set currentprofile firewallpolicy blockinboundalways,allowoutbound

 

c.     netsh advfirewall set domainprofile state on
netsh advfirewall set domainprofile firewallpolicy blockinbound,allowoutbound

 

d.     netsh advfirewall set domainprofile state on
netsh advfirewall set private profile state on

 

 

7.     방화벽 설정 초기화

 

a.     Netsh advfirewall reset

 

 

8.     특정 서비스 허용

 

a.     netsh  advfirewall firewall set rule group=”File and Printer Sharing” new enable=yes

 

b.     netsh  advfirewall firewall set rule group=”remote desktop” new enable=yes

 

c.     netsh  advfirewall firewall set rule group=”remote desktop” new enable=yes profile=domain

 

 

d.     netsh advfirewall firewall set rule group=”remote desktop” new enable=yes profile=private