How to see what is reserving ephemeral port ranges on Windows?
I have a Windows application that needs to use ports 50005
and 50006
but it is being blocked.
I see the following when I run netsh int ip show excludedportrange protocol=tcp
:
Protocol tcp Port Exclusion Ranges
Start Port End Port
---------- --------
5357 5357
49709 49808
49809 49908
49909 50008
50009 50108
50109 50208
50280 50379
* - Administered port exclusions.
So something on my machine is reserving ports 49909
to 50008
, which is presumably what is causing my application to fail. I've tried deleting this excludedportrange
with the following command:
netsh int ip delete excludedportrange protocol=tcp numberofports=100 startport=49909
But I see an error Access is denied.
, which makes me think that whatever is reserving this ports is actively running, but I have no idea what that could be.
What's also weird is that after running that command, even though I saw an error, if I reboot the excludedportrange
will be different.
As a sanity check I've also run resmon.exe
and confirmed that there is nothing running on ports 50005
and 50006
.
How can I tell what is adding the excludedportrange
?
EDIT: I've narrowed this down to Hyper-V. If I disable Hyper-V then those ports are not excluded.
windows networking tcp port netsh
|
show 1 more comment
I have a Windows application that needs to use ports 50005
and 50006
but it is being blocked.
I see the following when I run netsh int ip show excludedportrange protocol=tcp
:
Protocol tcp Port Exclusion Ranges
Start Port End Port
---------- --------
5357 5357
49709 49808
49809 49908
49909 50008
50009 50108
50109 50208
50280 50379
* - Administered port exclusions.
So something on my machine is reserving ports 49909
to 50008
, which is presumably what is causing my application to fail. I've tried deleting this excludedportrange
with the following command:
netsh int ip delete excludedportrange protocol=tcp numberofports=100 startport=49909
But I see an error Access is denied.
, which makes me think that whatever is reserving this ports is actively running, but I have no idea what that could be.
What's also weird is that after running that command, even though I saw an error, if I reboot the excludedportrange
will be different.
As a sanity check I've also run resmon.exe
and confirmed that there is nothing running on ports 50005
and 50006
.
How can I tell what is adding the excludedportrange
?
EDIT: I've narrowed this down to Hyper-V. If I disable Hyper-V then those ports are not excluded.
windows networking tcp port netsh
why dont you try executing the netstat -a -b to figure out manually what services are being executed at the given ports
– Ankur Goel
Jan 2 at 17:12
If your application depends on specific ports, you need to use user ports and register those ports with IANA: "Assigned ports both System and User ports SHOULD NOT be used without or prior to IANA registration."
– Ron Maupin
Jan 2 at 17:25
"Access is denied" probably just because you ran a command prompt without elevation. Only elevated administrator processes can make changes to the network settings
– Ben Voigt
Jan 2 at 17:32
@AnkurGoel Nothing appears to be using anything in those port ranges.
– Liam
Jan 2 at 17:55
@BenVoigt I'm running the command prompt as administrator.
– Liam
Jan 2 at 17:55
|
show 1 more comment
I have a Windows application that needs to use ports 50005
and 50006
but it is being blocked.
I see the following when I run netsh int ip show excludedportrange protocol=tcp
:
Protocol tcp Port Exclusion Ranges
Start Port End Port
---------- --------
5357 5357
49709 49808
49809 49908
49909 50008
50009 50108
50109 50208
50280 50379
* - Administered port exclusions.
So something on my machine is reserving ports 49909
to 50008
, which is presumably what is causing my application to fail. I've tried deleting this excludedportrange
with the following command:
netsh int ip delete excludedportrange protocol=tcp numberofports=100 startport=49909
But I see an error Access is denied.
, which makes me think that whatever is reserving this ports is actively running, but I have no idea what that could be.
What's also weird is that after running that command, even though I saw an error, if I reboot the excludedportrange
will be different.
As a sanity check I've also run resmon.exe
and confirmed that there is nothing running on ports 50005
and 50006
.
How can I tell what is adding the excludedportrange
?
EDIT: I've narrowed this down to Hyper-V. If I disable Hyper-V then those ports are not excluded.
windows networking tcp port netsh
I have a Windows application that needs to use ports 50005
and 50006
but it is being blocked.
I see the following when I run netsh int ip show excludedportrange protocol=tcp
:
Protocol tcp Port Exclusion Ranges
Start Port End Port
---------- --------
5357 5357
49709 49808
49809 49908
49909 50008
50009 50108
50109 50208
50280 50379
* - Administered port exclusions.
So something on my machine is reserving ports 49909
to 50008
, which is presumably what is causing my application to fail. I've tried deleting this excludedportrange
with the following command:
netsh int ip delete excludedportrange protocol=tcp numberofports=100 startport=49909
But I see an error Access is denied.
, which makes me think that whatever is reserving this ports is actively running, but I have no idea what that could be.
What's also weird is that after running that command, even though I saw an error, if I reboot the excludedportrange
will be different.
As a sanity check I've also run resmon.exe
and confirmed that there is nothing running on ports 50005
and 50006
.
How can I tell what is adding the excludedportrange
?
EDIT: I've narrowed this down to Hyper-V. If I disable Hyper-V then those ports are not excluded.
windows networking tcp port netsh
windows networking tcp port netsh
edited Jan 2 at 19:29
Liam
asked Jan 2 at 17:05
LiamLiam
69721117
69721117
why dont you try executing the netstat -a -b to figure out manually what services are being executed at the given ports
– Ankur Goel
Jan 2 at 17:12
If your application depends on specific ports, you need to use user ports and register those ports with IANA: "Assigned ports both System and User ports SHOULD NOT be used without or prior to IANA registration."
– Ron Maupin
Jan 2 at 17:25
"Access is denied" probably just because you ran a command prompt without elevation. Only elevated administrator processes can make changes to the network settings
– Ben Voigt
Jan 2 at 17:32
@AnkurGoel Nothing appears to be using anything in those port ranges.
– Liam
Jan 2 at 17:55
@BenVoigt I'm running the command prompt as administrator.
– Liam
Jan 2 at 17:55
|
show 1 more comment
why dont you try executing the netstat -a -b to figure out manually what services are being executed at the given ports
– Ankur Goel
Jan 2 at 17:12
If your application depends on specific ports, you need to use user ports and register those ports with IANA: "Assigned ports both System and User ports SHOULD NOT be used without or prior to IANA registration."
– Ron Maupin
Jan 2 at 17:25
"Access is denied" probably just because you ran a command prompt without elevation. Only elevated administrator processes can make changes to the network settings
– Ben Voigt
Jan 2 at 17:32
@AnkurGoel Nothing appears to be using anything in those port ranges.
– Liam
Jan 2 at 17:55
@BenVoigt I'm running the command prompt as administrator.
– Liam
Jan 2 at 17:55
why dont you try executing the netstat -a -b to figure out manually what services are being executed at the given ports
– Ankur Goel
Jan 2 at 17:12
why dont you try executing the netstat -a -b to figure out manually what services are being executed at the given ports
– Ankur Goel
Jan 2 at 17:12
If your application depends on specific ports, you need to use user ports and register those ports with IANA: "Assigned ports both System and User ports SHOULD NOT be used without or prior to IANA registration."
– Ron Maupin
Jan 2 at 17:25
If your application depends on specific ports, you need to use user ports and register those ports with IANA: "Assigned ports both System and User ports SHOULD NOT be used without or prior to IANA registration."
– Ron Maupin
Jan 2 at 17:25
"Access is denied" probably just because you ran a command prompt without elevation. Only elevated administrator processes can make changes to the network settings
– Ben Voigt
Jan 2 at 17:32
"Access is denied" probably just because you ran a command prompt without elevation. Only elevated administrator processes can make changes to the network settings
– Ben Voigt
Jan 2 at 17:32
@AnkurGoel Nothing appears to be using anything in those port ranges.
– Liam
Jan 2 at 17:55
@AnkurGoel Nothing appears to be using anything in those port ranges.
– Liam
Jan 2 at 17:55
@BenVoigt I'm running the command prompt as administrator.
– Liam
Jan 2 at 17:55
@BenVoigt I'm running the command prompt as administrator.
– Liam
Jan 2 at 17:55
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010365%2fhow-to-see-what-is-reserving-ephemeral-port-ranges-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010365%2fhow-to-see-what-is-reserving-ephemeral-port-ranges-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
why dont you try executing the netstat -a -b to figure out manually what services are being executed at the given ports
– Ankur Goel
Jan 2 at 17:12
If your application depends on specific ports, you need to use user ports and register those ports with IANA: "Assigned ports both System and User ports SHOULD NOT be used without or prior to IANA registration."
– Ron Maupin
Jan 2 at 17:25
"Access is denied" probably just because you ran a command prompt without elevation. Only elevated administrator processes can make changes to the network settings
– Ben Voigt
Jan 2 at 17:32
@AnkurGoel Nothing appears to be using anything in those port ranges.
– Liam
Jan 2 at 17:55
@BenVoigt I'm running the command prompt as administrator.
– Liam
Jan 2 at 17:55