728x90
반응형
방화벽 규칙을 추가
명령 예제 1: 프로그램 사용
netsh advfirewall firewall add rule ?
netsh advfirewall firewall add rule name="My Application" dir=in action=allow program="C:\MyApp\MyApp.exe" enable=yes
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
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
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=private
명령 예제 2: 포트 사용
netsh advfirewall firewall add rule ?
netsh advfirewall firewall add rule name= "Open Port 80" dir=in action=allow protocol=TCP localport=80
명령 예제 3: 사용하도록 설정된 프로그램 또는 포트 삭제
netsh advfirewall firewall delete rule ?
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
명령 예제 4: ICMP 설정 구성
netsh advfirewall firewall add rule ?
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
netsh advfirewall firewall add rule name= "All ICMP V4" protocol=icmpv4:any,any dir=in action=allow
netsh advfirewall firewall add rule name="Block Type 13 ICMP V4" protocol=icmpv4:13,any dir=in action=block
명령 예제 5: 로깅 설정
netsh advfirewall set currentprofile ?
netsh advfirewall set currentprofile logging filename %systemroot%\system32\LogFiles\Firewall\pfirewall.log
netsh advfirewall set currentprofile logging maxfilesize 4096
netsh advfirewall set currentprofile logging droppedconnections enable
netsh advfirewall set currentprofile logging allowedconnections enable
명령 예제 6: Windows 방화벽 사용
netsh advfirewall set currentprofile ?
netsh advfirewall set currentprofile state on
Netsh advfirewall set currentprofile state on
netsh advfirewall set currentprofile firewallpolicy blockinboundalways,allowoutbound
Netsh advfirewall set domainprofile state on
netsh advfirewall set domainprofile firewallpolicy blockinbound,allowoutbound
netsh advfirewall set domainprofile state on
netsh advfirewall set privateprofile state on
명령 예제 7: 정책 기본값 복원
netsh advfirewall reset ?
netsh advfirewall reset
명령 예제 8: 특정 서비스 사용
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes profile=domain
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes profile=private
netsh 방화벽 대신 netsh advfirewall 방화벽을 사용하여 Windows 방화벽 동작 제어
출처 : netsh 방화벽 대신 netsh advfirewall 방화벽을 사용하여 Windows 방화벽 동작 제어 (velog.io)
728x90
반응형
'IT > Windows' 카테고리의 다른 글
Visual Basic Script - 재미로 알아보는 스크립팅 언어 (VBS) (0) | 2023.07.17 |
---|---|
WMI(Windows Management Instrumentation)와 데이터베이스 시스템의 통합 (0) | 2023.07.17 |
WMI(Windows Management Instrumentation)를 이용한 공격기법 (0) | 2023.07.17 |
MX 레코드가 무엇이고 어떻게 설정하나요? (0) | 2023.06.20 |
MSSQL 권한(grant) 설정 방법 - view,table등 (0) | 2023.05.09 |