netsh firewall add allowedprogram
[ program = ] path
[ name = ] name
[ [ mode = ] ENABLE|DISABLE
[ scope = ] ALL|SUBNET|CUSTOM
[ addresses = ] addresses
[ profile = ] CURRENT|DOMAIN|STANDARD|ALL ]
방화벽에서 허용할 프로그램 구성을 추가합니다.
매개 변수:
program - 프로그램의 경로 및 파일 이름
name - 프로그램 이름
mode - 프로그램 모드(옵션)
ENABLE - 방화벽을 통과할 수 있음(기본값)
DISABLE - 방화벽을 통과할 수 없음
scope - 프로그램 범위(옵션)
ALL - 모든 트래픽이 방화벽을 통과할 수 있음(기본값)
SUBNET - 로컬 네트워크(서브넷) 트래픽만 방화벽을 통과할 수 있음
CUSTOM - 지정한 트래픽만 방화벽을 통과할 수 있음
addresses - 사용자 지정 범위 주소(옵션).
profile - 구성 프로필(옵션)
CURRENT - 현재 프로필(기본값)
DOMAIN - 도메인 프로필
STANDARD - 표준 프로필
ALL - 모든 프로필
주의: 'addresses'를 지정하려면 'scope'에 'CUSTOM'을 선택해야 합니다.
예:
add allowedprogram C:\MyApp\MyApp.exe MyApp ENABLE
add allowedprogram C:\MyApp\MyApp.exe MyApp DISABLE
add allowedprogram C:\MyApp\MyApp.exe MyApp ENABLE CUSTOM 157.60.0.1,172.16.0.0/16,10.0.0.0/255.0.0.0,LocalSubnet
add allowedprogram program = C:\MyApp\MyApp.exe name = MyApp mode = ENABLE
add allowedprogram program = C:\MyApp\MyApp.exe name = MyApp mode = DISABLE
add allowedprogram program = C:\MyApp\MyApp.exe name = MyApp mode = ENABLE scope = CUSTOM addresses = 157.60.0.1,172.16.0.0/16,10.0.0.0/255.0.0.0,LocalSubnet
<실례>
추가 - XP
netsh firewall add allowedprogram "%programfiles%\internet explorer\iexplore.exe" "Internet Explorer" enable
추가 - VISTA/7
netsh advfirewall firewall add rule name="Internet Explorer" dir=in action=allow program="%programfiles%\internet explorer\iexplore.exe" enable=yes
삭제 - XP
netsh firewall delete allowedprogram "%programfiles%\internet explorer\iexplore.exe"
삭제 - VISTA/7
netsh advfirewall firewall delete rule name="Internet Explorer" program="%programfiles%\internet explorer\iexplore.exe"
추가 - VISTS/7
netsh advfirewall firewall add rule name="Deny Malware" dir=out action=block program="%programfiles%\xxx\xxx.exe" enable=yes profile=any remoteip=192.168.0.1