성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] Java - How to use the Foreign Funct...
[정성태] 제가 큰 실수를 했군요. ^^; Delegate를 통한 Bein...
[정성태] Working with Rust Libraries from C#...
[정성태] Detecting blocking calls using asyn...
[정성태] 아쉽게도, 커뮤니티는 아니고 개인 블로그입니다. ^^
[정성태] 질문이 잘 이해가 안 됩니다. 우선, 해당 소스코드에서 ILis...
[양승조
] var대신 dinamic으로 선언해서 해결은 했습니다. 맞는 해...
[양승조
] 또 막혔습니다. ㅠㅠ var list = props[i].Ge...
[양승조
] 아. 감사합니다. 어제는 안됐던것 같은데....정신을 차려야겠네...
[정성태] "props[i].GetValue(props[i])" 코드에서 ...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>"Administered port exclusions" 설명</h1> <p> 문서에 따르면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > You cannot exclude ports by using the ReservedPorts registry key in Windows Server 2008 or in Windows Server 2008 R2 ; <a target='tab' href='https://support.microsoft.com/en-us/help/2665809/you-cannot-exclude-ports-by-using-the-reservedports-registry-key-in-wi'>https://support.microsoft.com/en-us/help/2665809/you-cannot-exclude-ports-by-using-the-reservedports-registry-key-in-wi</a> </pre> <br /> <div style='BACKGROUND-COLOR: #ccffcc; padding: 10px 10px 5px 10px; MARGIN: 0px 10px 10px 10px; FONT-FAMILY: Malgun Gothic, Consolas, Verdana; COLOR: #005555'> Note In this example, "*" refers to port exclusions that were added by using the Netshell command prompt utility.<br /> </div><br /> <br /> "*" 항목은 netsh 명령어로 직접 추가한 포트 범위라고 합니다. 실제로 제 테스트 PC에서 excludedportrange를 보면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > C:\WINDOWS\system32> <span style='color: blue; font-weight: bold'>netsh int ipv4 show excludedportrange protocol=tcp</span> Protocol tcp Port Exclusion Ranges Start Port End Port ---------- -------- 80 80 5357 5357 8010 8010 <span style='color: blue; font-weight: bold'> 50000 50059 *</span> 63759 63858 63859 63958 63959 64058 * - Administered port exclusions. </pre> <br /> 50000으로부터 60개의 포트가 (문서에 따라) netsh로 추가된 것이라고 나옵니다. 그럼 나머지는 어떻게 추가된 것일까요? 역시 동일한 문서에는,<br /> <br /> <div style='BACKGROUND-COLOR: #ccffcc; padding: 10px 10px 5px 10px; MARGIN: 0px 10px 10px 10px; FONT-FAMILY: Malgun Gothic, Consolas, Verdana; COLOR: #005555'> an exclusion that is added by using the <a target='tab' href='https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-createpersistenttcpportreservation'>CreatePersistentTcpPortReservation</a> or <a target='tab' href='https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-createpersistentudpportreservation'>CreatePersistentUdpPortReservation</a> function cannot be deleted by using the Netshell command prompt utility.<br /> </div><br /> <br /> API에 의해서도 추가할 수 있다고 하며 그것은 netsh로 삭제할 수 없다고 합니다. 실제로 '*' 표시가 없는 항목을 neth로 삭제를 시도하면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > C:\WINDOWS\system32> <span style='color: blue; font-weight: bold'>netsh int ipv4 delete excludedportrange protocol=tcp startport=63759 numberofports=100</span> Access is denied. </pre> <br /> 관리자 권한으로 실행했음에도 저렇게 권한이 없다는 오류 메시지가 발생합니다. <br /> <br /> <hr style='width: 50%' /><br /> <br /> <span style='text-decoration: line-through'>해본 것은 아니지만, 아마도</span> '*' 표시가 없는 항목들을 삭제하려면 DeletePersistentTcpPortReservation API를 사용해야 할 것입니다. (업데이트 2020-09-01: <a target='tab' href='https://www.sysnet.pe.kr/2/0/12305'>해당 API를 사용해 삭제하는 도구</a>)<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > DeletePersistentTcpPortReservation function (is defined on Windows Vista and later.) ; <a target='tab' href='https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-deletepersistenttcpportreservation'>https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-deletepersistenttcpportreservation</a> </pre> <br /> 참고로, 전에 제가 썼던 글에서는,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > 소켓 바인딩 시 "System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions" 오류 발생 ; <a target='tab' href='https://www.sysnet.pe.kr/2/0/12240'>https://www.sysnet.pe.kr/2/0/12240</a> </pre> <br /> 꽤나 많은 포트들이 점유된 것을 볼 수 있는데, 프로그래머가 아닌 운영체제 관리자 입장에서 저런 포트들을 정리하고 싶을 때 API를 사용하는 것은 말이 안 됩니다. 그런 경우, "<a target='tab' href='https://www.sysnet.pe.kr/2/0/12295#ip_reset'>netsh int ip reset</a>" 명령어를 사용하면 정리가 되긴 합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > C:\Windows\System32> <span style='color: blue; font-weight: bold'>netsh int ip reset</span> Resetting Compartment Forwarding, OK! Resetting Compartment, OK! Resetting Control Protocol, OK! Resetting Echo Sequence Request, OK! Resetting Global, OK! Resetting Interface, OK! Resetting Anycast Address, OK! Resetting Multicast Address, OK! Resetting Unicast Address, OK! Resetting Neighbor, OK! Resetting Path, OK! Resetting Potential, OK! Resetting Prefix Policy, OK! Resetting Proxy Neighbor, OK! Resetting Route, OK! Resetting Site Prefix, OK! Resetting Subinterface, OK! Resetting Wakeup Pattern, OK! Resetting Resolve Neighbor, OK! Resetting , OK! Resetting , OK! Resetting , OK! Resetting , OK! Resetting , failed. Access is denied. Resetting , OK! Resetting , OK! Resetting , OK! Resetting , OK! Resetting , OK! Resetting , OK! Resetting , OK! Restart the computer to complete this action. </pre> <br /> 단지, 주의할 점이 있다면 출력 결과를 보면 짐작할 수 있듯이 여러 가지 항목들을 함께 초기화시키므로 저 항목 중에 사용자 정의한 구성은 삭제될 수 있다는 점!<br /> <br /> <hr style='width: 50%' /><br /> <br /> 다음의 글에 보면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Administered Port Exclusions blocking high ports ; <a target='tab' href='https://dandini.wordpress.com/2019/07/15/administered-port-exclusions-blocking-high-ports/'>https://dandini.wordpress.com/2019/07/15/administered-port-exclusions-blocking-high-ports/</a> </pre> <br /> 레지스트리 키 설명이 하나 나오는데,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > HKLM\SYSTEM\CurrentControlSet\Services\hns\State /v EnableExcludedPortRange </pre> <br /> 기본적으로 EnableExcludedPortRange 항목은 등록이 안 되어 있습니다. 해당 글에 보면 Hyper-V가 설치된 시스템에서 50000 포트 영역의 항목이 있었다고 하지만 제가 관리하는 시스템 중에는 VM 내에서도 있는 걸로 보아 꼭 그런 것은 아닌 것 같습니다.<br /> <br /> 어쨌든, 저렇게 점유하는 항목을 없애려면 EnableExcludedPortRange 설정을 레지스트리에 추가하면 됩니다. 그다음 재부팅을 하면 다음과 같이 50000 포트 영역이 없어진 것을 확인할 수 있습니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > C:\WINDOWS\system32> <span style='color: blue; font-weight: bold'>netsh int ipv4 show excludedportrange protocol=tcp</span> Protocol tcp Port Exclusion Ranges Start Port End Port ---------- -------- 80 80 5357 5357 8010 8010 64269 64368 64369 64468 64469 64568 * - Administered port exclusions. </pre> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
1932
(왼쪽의 숫자를 입력해야 합니다.)