7

I want to open port 8888 on local Windows environment but no luck. Or how can I check Windows Event Log for failed at opening port 8888?

Here is the result of all listening port start with 8xxx netstat -an | findstr :8

  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING                                
  TCP    0.0.0.0:808            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8001           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8002           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8003           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8004           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8005           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8006           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8007           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8008           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8009           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8010           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8011           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8012           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8013           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8014           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8015           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8081           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8082           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8083           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8084           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8088           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8089           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8090           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:8443           0.0.0.0:0              LISTENING
  TCP    127.0.0.1:8001         0.0.0.0:0              LISTENING
  TCP    127.0.0.1:8183         0.0.0.0:0              LISTENING
  TCP    [::]:80                [::]:0                 LISTENING
  TCP    [::]:8001              [::]:0                 LISTENING
  TCP    [::]:8002              [::]:0                 LISTENING
  TCP    [::]:8003              [::]:0                 LISTENING
  TCP    [::]:8004              [::]:0                 LISTENING
  TCP    [::]:8005              [::]:0                 LISTENING
  TCP    [::]:8006              [::]:0                 LISTENING
  TCP    [::]:8007              [::]:0                 LISTENING
  TCP    [::]:8008              [::]:0                 LISTENING
  TCP    [::]:8009              [::]:0                 LISTENING
  TCP    [::]:8010              [::]:0                 LISTENING
  TCP    [::]:8011              [::]:0                 LISTENING
  TCP    [::]:8012              [::]:0                 LISTENING
  TCP    [::]:8013              [::]:0                 LISTENING
  TCP    [::]:8014              [::]:0                 LISTENING
  TCP    [::]:8015              [::]:0                 LISTENING
  TCP    [::]:8080              [::]:0                 LISTENING
  TCP    [::]:8081              [::]:0                 LISTENING
  TCP    [::]:8082              [::]:0                 LISTENING
  TCP    [::]:8083              [::]:0                 LISTENING
  TCP    [::]:8084              [::]:0                 LISTENING
  TCP    [::]:8088              [::]:0                 LISTENING
  TCP    [::]:8089              [::]:0                 LISTENING
  TCP    [::]:8090              [::]:0                 LISTENING
  TCP    [::]:8443              [::]:0                 LISTENING

Here is the System Protocol Port Exclusion Ranges netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
        80          80
      1657        1756
      1757        1856
      1857        1956
      1957        2056
      2281        2380
      2381        2480
      2481        2580
      2581        2680
      3069        3168
      3169        3268
      3390        3489
      3490        3589
      4111        4210
      4211        4310
      4311        4410
      4444        4543
      5433        5532
      5556        5655
      5656        5755
      5756        5855
      6868        6967
      7006        7105
      7106        7205
      7206        7305
      8844        8943
      9192        9291
      9292        9391
      9392        9491
     10843       10942
     10943       11042
     11043       11142
     11143       11242
     12080       12179
     12180       12279
     12280       12379
     12380       12479
     14208       14307
     14308       14407
     14408       14507
     14508       14607
     16642       16741
     16742       16841
     16842       16941
     16942       17041
     19174       19273
     19274       19373
     19374       19473
     19474       19573
     21903       22002
     22003       22102
     22103       22202
     22203       22302
     24835       24934
     24935       25034
     25035       25134
     25135       25234
     50000       50059     *

* - Administered port exclusions.
2
  • Did you try this with admin rights or without?
    – Daniel B
    Aug 9, 2019 at 7:30
  • Yes, sure, both with or without admin rights, turn on/off firewall, ... no luck. Anyway, I've found the reason and added the answer below. Thanks! Aug 9, 2019 at 7:38

2 Answers 2

4

The reason is that Hyper-V takes over these ports, to prevent it from happening do the following:

  1. dism.exe /Online /Disable-Feature:Microsoft-Hyper-V (then restart)
  2. netsh int ipv4 add excludedportrange protocol=tcp startport=<your port, mycase: 8888> numberofports=1
  3. dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All (then restart)

The original solution is here.

If after that you still can't bind to the port do the following:

  • netsh http add iplisten 0.0.0.0 for IPv4
  • netsh http add iplisten :: for IPv6

More information is here.

3

The answer by @TheAnhNguyen (relating to Hyper-V) is one potential cause of the issue.

However, the issue was different for me. In my case, it's because Windows started with its "dynamic ports" configured to start at port 1025 and end at port 5000. Because of this, when Docker Desktop started up, it would reserve its ports within the 1025-5000 port range, which was (sometimes!) conflicting with the ports that my own programs were configured to reserve/use. (for port-forwarding from my local Kubernetes cluster to localhost)

To see if your dynamic-ports is set incorrectly, you can run:

netsh int ipv4 show dynamicport tcp

If you see Start Port: 1025, then the dynamic-ports range is misconfigured. To fix it, you'll need to set it to a more sensible range -- avoiding the <10k ports. (which is typically where devs place their own apps)

To set it to the recommended range: (if your issue is with ipv6, then adjust the command accordingly)

netsh int ipv4 set dynamic tcp start=49152 num=16384

For more info, see here: https://stackoverflow.com/a/62359555/2441655

1
  • A reboot after this helped my situation May 12, 2022 at 20:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .