I have a Server 2003 SP1 machine with all the latest updates. IIS is
running on on this machine and I have 7 virtual websites set up. I have
added a second static IP address to one NIC I have in the machine. I
need to make IIS listen on only the first IP address and not the second.

Here is what I have done:

1) Went to every website and changed the ip address in the pull down to
the second IP address. This didn't work.

2) Stopped IIS (using iisreset /stop) and issued the command:
"httpcfg set iplisten -i <second ip address>" This returned:
"HttpSetServiceConfiguration completed with 0.".
I then issued the command "httpcfg query iplisten". This returned:
IP : <first ip address>
--------------------------------------
Started IIS (suing iisreset /start).
This didn't work

3) Stopped IIS (using iisreset /stop) and issued the command:
"cscript adsutil.vbs set w3svc/disablesocketpooling true" This returned:
disablesocketpooling : (BOOLEAN) True
I then issued the command:
"httpcfg set iplisten -i <second ip address>" This returned:
"HttpSetServiceConfiguration completed with 0.".
I then issued the command "httpcfg query iplisten". This returned:
IP : <first ip address>
--------------------------------------
Started IIS (suing iisreset /start).
This didn't work

To confirm that IIS was still listening to the second IP address, I
pointed a web browser on a machine on the same network to the second IP
address. When I returned "Bad Request (Invalid Hostname)", I knew that
IIS was answering.

Anyone have any ideas?

TIA

RE: Can't make IIS listen on only one IP by wjzhang

wjzhang
Fri Sep 22 02:47:30 CDT 2006

Hi Irwin,

If you want to set IIS6 only listens on specific IP address, using httpcfg
to do this is the correct way.

Please run the following commands:

1. httpcfg delete iplisten -i 0.0.0.0

This removes IIS from listening on all available IPs 0.0.0.0

2. httpcfg delete iplisten -i <second ip address>

Removes IIS from listening on the second IP

3. 2. httpcfg set iplisten -i <first ip address>

Expliclitly configure IIS to be listening on the first IP

4. httpcfg query iplisten

Check the HTTP.sys IP listening list, you should only see the first IP in
it.


After this above, please run:

net stop http
net start http
iisreset

to restart HTTP service before restarting IIS. Restart IIS services will
not make the changes of HTTP.sys take effect. Or you may reboot the server.

Please check if it works this time. If problem still persists, I will
assist you on the troubleshooting.

Have a great weekend.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


Re: Can't make IIS listen on only one IP by Irwin

Irwin
Sat Sep 23 05:01:23 CDT 2006

Here is what I entered and the results:

httpcfg delete iplisten -i 0.0.0.0
HttpDeleteServiceConfiguration completed with 1168

httpcfg delete iplisten -i <second ip address>
HttpDeleteServiceConfiguration completed with 1168

httpcfg set iplisten -i <first ip address>
HttpSetServiceConfiguration completed with 0

httpcfg query iplisten
IP : <first ip address>

Not working at this point (web browser gets similar error as before).

Rebooted the machine. Everything works now. Thanks for your help!

WenJun Zhang[msft] wrote:
> Hi Irwin,
>
> If you want to set IIS6 only listens on specific IP address, using httpcfg
> to do this is the correct way.
>
> Please run the following commands:
>
> 1. httpcfg delete iplisten -i 0.0.0.0
>
> This removes IIS from listening on all available IPs 0.0.0.0
>
> 2. httpcfg delete iplisten -i <second ip address>
>
> Removes IIS from listening on the second IP
>
> 3. 2. httpcfg set iplisten -i <first ip address>
>
> Expliclitly configure IIS to be listening on the first IP
>
> 4. httpcfg query iplisten
>
> Check the HTTP.sys IP listening list, you should only see the first IP in
> it.
>
>
> After this above, please run:
>
> net stop http
> net start http
> iisreset
>
> to restart HTTP service before restarting IIS. Restart IIS services will
> not make the changes of HTTP.sys take effect. Or you may reboot the server.
>
> Please check if it works this time. If problem still persists, I will
> assist you on the troubleshooting.
>
> Have a great weekend.
>
> Sincerely,
>
> WenJun Zhang
>
> Microsoft Online Community Support
>
> ==================================================
>
> Get notification to my posts through email? Please refer to:
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at:
>
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
>
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>


Re: Can't make IIS listen on only one IP by wjzhang

wjzhang
Sun Sep 24 23:11:54 CDT 2006

You are welcome Irwin.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.