'방화벽'에 해당되는 글 2건

  1. 2016.06.07 netsh 명령어로 방화벽 설정, 네트워크 정보 보기 by 랩터 인터내셔널
  2. 2016.04.23 netsh 명령어로 방화벽 설정, 네트워크 정보 보기 by 랩터 인터내셔널

방화벽에서 특정 포트를 오픈해야 하는 경우 물론 firewall.cpl 이나 wf.msc 등의 GUI 환경에서 설정할 수도 있지만, 대량으로 처리해야 하는 경우라면 커맨드로 작업하는게 훨씬 편리합니다.

간단히 예제를 보여드리겠습니다.

TCP 7777 포트를 오픈하고 싶다면

윈도우 2008 이상

netsh advfirewall firewall add rule name="test" dir=in action=allow protocol=tcp localport=7777


윈도우 2003

netsh firewall add portopening tcp 7777 "test"


위 예제는 가장 일반적인 TCP 포트 인바운트 허용 규칙을 추가하는 것이었고, 좀 더 상세한 작업을 원하신다면 도움말 참고해서 작업하시면 되겠습니다.

윈도우 2008 이상에서는 아래 명령어를 입력해보세요.

netsh advfirewall firewall add rule

아래는 도움말에 나오는 예제입니다.

      messenger.exe에 대해 캡슐화 보안이 적용되지 않은 인바운드 규칙을 추가합니다.
      netsh advfirewall firewall add rule name="allow messenger"
      dir=in program="c:\programfiles\messenger\msmsgs.exe"
      security=authnoencap action=allow
      포트 80에 대한 아웃바운드 규칙을 추가합니다.
      netsh advfirewall firewall add rule name="allow80"
      protocol=TCP dir=out localport=80 action=block
      TCP 포트 80 트래픽에 대해 보안 및 암호화를 요구하는
      인바운드 규칙을 추가합니다.
      netsh advfirewall firewall add rule
      name="Require Encryption for Inbound TCP/80"
      protocol=TCP dir=in localport=80 security=authdynenc
      action=allow
      messenger.exe에 대해 인바운드 규칙을 추가하고 보안을 요청합니다.
      netsh advfirewall firewall add rule name="allow messenger"
      dir=in program="c:\program files\messenger\msmsgs.exe"
      security=authenticate action= allow
     SDDL 문자열로 식별된 그룹 acmedomain\nscanners에 대해
     인증된 방화벽 통과 규칙을 추가합니다.
     netsh advfirewall firewall add rule name="allow scanners"
     dir=in rmtcomputergrp=<SDDL 문자열> action=bypass
     security=authenticate
      UDP 연결에 사용되는 로컬 포트 5000-5010에 대해 아웃바운드 허용 규칙을 추가합니다.
      Add rule name="Allow port range" dir=out protocol=udp localport=5000-5010 action=allow


윈도우 2003 에서는 아래 명령어를 입력해보세요.

netsh firewall add portopening

아래는 도움말에 나오는 예제입니다.

      add portopening TCP 80 MyWebPort                                             
      add portopening UDP 500 IKE ENABLE ALL                                       
      add portopening ALL 53 DNS ENABLE CUSTOM                                     
          157.60.0.1,172.16.0.0/16,10.0.0.0/255.0.0.0,LocalSubnet        
      add portopening protocol = TCP port = 80 name = MyWebPort                    
      add portopening protocol = UDP port = 500 name = IKE mode = ENABLE scope = ALL
      add portopening protocol = ALL port = 53 name = DNS mode = ENABLE            
          scope = CUSTOM addresses =                                     
          157.60.0.1,172.16.0.0/16,10.0.0.0/255.0.0.0,LocalSubnet


어차피 모든 명령어의 사용법을 외울 수는 없습니다. 그리고 외울 필요도 없습니다. 그냥 윈도우에 이런 명령어가 있다는 사실만 알아두시면 되겠습니다. 나중에 필요할 때가 찾아오면 그 때 다시 검색해서 사용하면 되니까요.

※ 동우님 질문에 답변

2008 기준으로 예제 보여드리겠습니다.

O 2000-3000 포트 차단하는 방법
netsh advfirewall firewall add rule name="동우" dir=in action=block protocol=tcp localport=2000-3000

O 적용된 규칙 보기
netsh advfirewall firewall show rule name="동우"

O 삭제하는 방법
netsh advfirewall firewall delete rule name="동우"

적용된 규칙 보기나 삭제하는 방법에 name=all 값을 주면 모든 규칙을 불러오거나 삭제합니다. 자세한 사용법을 확인하려면 아래 명령어를 각각 입력해보세요.

netsh advfirewall firewall add rule
netsh advfirewall firewall delete rule
netsh advfirewall firewall show rule
netsh advfirewall firewall set rule


출처 - http://www.snoopybox.co.kr/1627


1. TCP/UDP 동적 포트 범위 확인

C:\> NETSH INT IPV4 SHOW DYNAMICPORT TCP(UDP)

 

23421C4E5478053C342658

 

 

2. TCP 글로벌 매개 변수, MTU 크기 확인

C:\> NETSH INT TCP SHOW GLOBAL

C:\> NETSH INT IPV4 SHOW INT 

 

214F424E5478053C244381

 

 

 

[참고자료]

Netsh commands for Interface Internet Protocol version 4 (IPv4)
http://technet.microsoft.com/en-us/library/cc731521(v=ws.10).aspx

 

The default dynamic port range for TCP/IP has changed in Windows Vista and in Windows Server 2008
http://support.microsoft.com/kb/929851/en-us

 

How to configure RPC dynamic port allocation to work with firewalls
http://support.microsoft.com/kb/154596


출처 - http://laigo.kr/761

반응형
Posted by 랩터 인터내셔널

방화벽에서 특정 포트를 오픈해야 하는 경우 물론 firewall.cpl 이나 wf.msc 등의 GUI 환경에서 설정할 수도 있지만, 대량으로 처리해야 하는 경우라면 커맨드로 작업하는게 훨씬 편리합니다.

간단히 예제를 보여드리겠습니다.

TCP 7777 포트를 오픈하고 싶다면

윈도우 2008 이상

netsh advfirewall firewall add rule name="test" dir=in action=allow protocol=tcp localport=7777


윈도우 2003

netsh firewall add portopening tcp 7777 "test"


위 예제는 가장 일반적인 TCP 포트 인바운트 허용 규칙을 추가하는 것이었고, 좀 더 상세한 작업을 원하신다면 도움말 참고해서 작업하시면 되겠습니다.

윈도우 2008 이상에서는 아래 명령어를 입력해보세요.

netsh advfirewall firewall add rule

아래는 도움말에 나오는 예제입니다.

      messenger.exe에 대해 캡슐화 보안이 적용되지 않은 인바운드 규칙을 추가합니다.
      netsh advfirewall firewall add rule name="allow messenger"
      dir=in program="c:\programfiles\messenger\msmsgs.exe"
      security=authnoencap action=allow
      포트 80에 대한 아웃바운드 규칙을 추가합니다.
      netsh advfirewall firewall add rule name="allow80"
      protocol=TCP dir=out localport=80 action=block
      TCP 포트 80 트래픽에 대해 보안 및 암호화를 요구하는
      인바운드 규칙을 추가합니다.
      netsh advfirewall firewall add rule
      name="Require Encryption for Inbound TCP/80"
      protocol=TCP dir=in localport=80 security=authdynenc
      action=allow
      messenger.exe에 대해 인바운드 규칙을 추가하고 보안을 요청합니다.
      netsh advfirewall firewall add rule name="allow messenger"
      dir=in program="c:\program files\messenger\msmsgs.exe"
      security=authenticate action= allow
     SDDL 문자열로 식별된 그룹 acmedomain\nscanners에 대해
     인증된 방화벽 통과 규칙을 추가합니다.
     netsh advfirewall firewall add rule name="allow scanners"
     dir=in rmtcomputergrp=<SDDL 문자열> action=bypass
     security=authenticate
      UDP 연결에 사용되는 로컬 포트 5000-5010에 대해 아웃바운드 허용 규칙을 추가합니다.
      Add rule name="Allow port range" dir=out protocol=udp localport=5000-5010 action=allow


윈도우 2003 에서는 아래 명령어를 입력해보세요.

netsh firewall add portopening

아래는 도움말에 나오는 예제입니다.

      add portopening TCP 80 MyWebPort                                             
      add portopening UDP 500 IKE ENABLE ALL                                       
      add portopening ALL 53 DNS ENABLE CUSTOM                                     
          157.60.0.1,172.16.0.0/16,10.0.0.0/255.0.0.0,LocalSubnet        
      add portopening protocol = TCP port = 80 name = MyWebPort                    
      add portopening protocol = UDP port = 500 name = IKE mode = ENABLE scope = ALL
      add portopening protocol = ALL port = 53 name = DNS mode = ENABLE            
          scope = CUSTOM addresses =                                     
          157.60.0.1,172.16.0.0/16,10.0.0.0/255.0.0.0,LocalSubnet


어차피 모든 명령어의 사용법을 외울 수는 없습니다. 그리고 외울 필요도 없습니다. 그냥 윈도우에 이런 명령어가 있다는 사실만 알아두시면 되겠습니다. 나중에 필요할 때가 찾아오면 그 때 다시 검색해서 사용하면 되니까요.

※ 동우님 질문에 답변

2008 기준으로 예제 보여드리겠습니다.

O 2000-3000 포트 차단하는 방법
netsh advfirewall firewall add rule name="동우" dir=in action=block protocol=tcp localport=2000-3000

O 적용된 규칙 보기
netsh advfirewall firewall show rule name="동우"

O 삭제하는 방법
netsh advfirewall firewall delete rule name="동우"

적용된 규칙 보기나 삭제하는 방법에 name=all 값을 주면 모든 규칙을 불러오거나 삭제합니다. 자세한 사용법을 확인하려면 아래 명령어를 각각 입력해보세요.

netsh advfirewall firewall add rule
netsh advfirewall firewall delete rule
netsh advfirewall firewall show rule
netsh advfirewall firewall set rule


출처 - http://www.snoopybox.co.kr/1627


1. TCP/UDP 동적 포트 범위 확인

C:\> NETSH INT IPV4 SHOW DYNAMICPORT TCP(UDP)

 

23421C4E5478053C342658

 

 

2. TCP 글로벌 매개 변수, MTU 크기 확인

C:\> NETSH INT TCP SHOW GLOBAL

C:\> NETSH INT IPV4 SHOW INT 

 

214F424E5478053C244381

 

 

 

[참고자료]

Netsh commands for Interface Internet Protocol version 4 (IPv4)
http://technet.microsoft.com/en-us/library/cc731521(v=ws.10).aspx

 

The default dynamic port range for TCP/IP has changed in Windows Vista and in Windows Server 2008
http://support.microsoft.com/kb/929851/en-us

 

How to configure RPC dynamic port allocation to work with firewalls
http://support.microsoft.com/kb/154596

 

반응형

'TIP&TECH' 카테고리의 다른 글

인텔 메인보드 칩셋 종류, 스펙확인하기  (0) 2016.04.23
인텔 cpu 스펙, 종류 확인하기  (0) 2016.04.23
QoS (Quality of Service)  (0) 2016.04.23
라우터 명령어 모음  (0) 2016.04.23
프로비저닝과 멀티테넌트  (0) 2016.04.23
Posted by 랩터 인터내셔널