Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have another service that needs to use multiple ports on one IP of a server. When IIS starts, it uses all unused IPs so the other service fails to bind its IP. If I start the other service first it is able to use the IP but I can't rely on the order of services starting or that they won't need to be restarted at some point. Is there any way to make IIS not use an IP at all?

share|improve this question

4 Answers 4

up vote 3 down vote accepted

Apparently in IIS6 the UI setting is broken and this needs to be done using httpcfg of which the gist is:

Type the following, where xxx.xxx.x.x is the IP address you want to add:

httpcfg set iplisten -i xxx.xxx.x.x

When this succeeds, Httpcfg returns the following: HttpSetServiceConfiguration completed with 0

To view additional status codes, see the Httpcfg help. After the IP address is added, use the following command to list it:

httpcfg query iplisten

Httpcfg returns the following: IP :xxx.xxx.x.x. Restart the service

share|improve this answer
    
This does not work. Even when specifying only one IP IIS makes port 80 on the other IPs unavailable to other applications. –  Dave Forgac Jan 7 '10 at 15:19
    
I guess this is the workaround for that problem in IIS6: support.microsoft.com/default.aspx?scid=kb;EN-US;813368 –  Oskar Duveborn Jan 7 '10 at 15:30
    
After your edit this is the correct answer –  Dave Forgac Jan 15 '10 at 11:12

I finally found the answer:

http://devlicio.us/blogs/billy_mccafferty/archive/2008/09/02/prevent-iis-from-binding-to-all-assigned-ip-addresses.aspx

There's a utility called httpcfg.exe that can be used to specify on which IPs IIS will listen.

share|improve this answer

I downloaded the support tools ( http://msdn.microsoft.com/en-us/library/windows/desktop/aa364478%28v=vs.85%29.aspx ) and used httpcfg.exe as described in several posts (i.e. stop http service, add desired ip numbers excluding the one I needed to bind elsewhere). I got to the point where

httpcfg query iplisten

no longer listed my exclusion number. However, running

netstat -anb -p tcp >netstat.txt

and looking at the netstat.txt revealed that PID 4 was still listening to port 80 (and 443) on ALL ip numbers via 0.0.0.0. Thus the ip number that I needed separated out was not yet available for use.

The final step was to explicitly DELETE 0.0.0.0 -- even though it was not on the iplisten list.

net stop http /y
httpcfg.exe delete iplisten -i 0.0.0.0:80
iisreset.exe

THAT worked immediately. No server reboot required, by the way.

share|improve this answer

Sure. Fire up Internet Information Services Manager. Expand until you see your sites under "Web Sites."

For each site, right-click and choose Properties. On the Web Site tab click "Advanced" next to IP Address and fill in only the addresses you want used (instead of the default "All Unassigned")

share|improve this answer
    
This does not work. Even when specifying only one IP IIS makes port 80 on the other IPs unavailable to other applications. –  Dave Forgac Jan 7 '10 at 15:21
    
I'll be darned, wasn't aware of that. I learned something today :-) –  Chris_K Jan 7 '10 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.