20

The Windows IP Helper Service (iphlpsvc) is using port 9200 on my system (Windows 10), which is also used by Elasticsearch by default. Obviously, I could just set Elasticsearch to use another port, but it's a bit annoying since ES uses 9200 everywhere else.

I was wondering if there is any way to configure iphlpsvc to use another port? When I stop iphlpsvc and restart it after starting ES on 9200, it doesn't seem to be blocking any other port (based on Get-NetTCPConnection -OwningProcess 28824, 28824 being the new PID), which makes me think it's not running properly.

I am also wondering if I am the only one experiencing this conflict between Elasticsearch and iphlpsvc on Windows - the only other mention of this issue I could find is here: https://forums.docker.com/t/solved-startup-of-containers-fails-on-local-port-binding/18654

2 Answers2

44

I just spent quite a bit of time resolving a similar issue, hopefully this will help some others who are struggling with the same.

The Windows IP Helper service (behind svchost) is just that: just a helper. It doesn't bind or reserve any ports by itself out of the box - it only starts doing that because other applications ask for it. In my case, it was netsh, I had setup port forwarding to WSL2 (just like @amra above) and forgot about it. It might be that this also solves your problem.

The way to figure out whether netsh is making IP Helper (iphlpsvc) reserve ports (and forward them to e.g. WSL) is the following:

In an Powershell prompt (as administrator, run): netsh interface portproxy show all

If the port that you need (which iphlpsvc is blocking) is on that list, then netsh is your main culprit (not iphlpsvc). Use:

netsh interface portproxy delete help

to figure out how to delete the line. (it needs the port number and the listening address as parameters). In my case, the following worked:

netsh interface portproxy delete v4tov4 listenport=27117 listenaddress=0.0.0.0

After running this the port claim was gone and I could keep the service running + startup the previously-blocked application normally.

If iphlpsvc is using 'your port', you have to figure out which other application told iphlpsvc to do so. If anybody knows of other applications that are likely culprits, please add them here :)

2

I don't know of a way to reconfigure the Windows IP Helper Service. It is probably impossible to change its listening port.

However, this service is not absolutely required. It effectively allows connections to take place across various Windows 10 networking protocols, like IPv6 and Port Proxy among others. It is mainly useful for running remote databases or connecting over IPv6.

If you can live without IPv6 and various other services, the simplest solution will be to disable this service and stop it from running.

  • Run Start > Services

  • Scroll down the list to find "IP Helper"

  • Double-click it and select Properties

  • To disable the service temporarily, select Stop > Apply > OK

  • To disable the service permanently, set the Startup Type to Disabled from the drop-down menu, then select Apply > OK.

  • Restart Windows.

harrymc
  • 498,455