Binding services to IP addresses

When binding a Service to an IP address, it has the following effect:

 

The IP address you bind to cannot be allocated by any other application on the same port number. For example, if you bind the SMTP service to the LAN IP address192.168.0.1 on port 25, nothing else will be able to bind to that IP and port number.

 

The service can only be accessed by connecting to that IP address and port number.

 


On a multi-homed Machine

On a machine with multiple IP addresses (multi-homed) and multiple Services with the following configuration:

 

You would need to follow these steps to successfully restart the service after making any changes:

  1. Stop the service you are going to modify

  2. make the changes as required

  3. Stop the service bound to 'Any unbound address'

  4. Restart the service stopped in 1 above

  5. Restart The service bound to 'Any unbound address'

 

This is necessary as the service that is bound to 'Any unbound address' actually binds to ALL unbound IP addresses on the defined port number.

 

So for an example using the above situation of three IP addresses, two web services bound to specific IP addresses and one further Web service bound to Any unbound address. Using the addresses 192.168.0.1, 192.168.0.2 and 192.168.0.3 this is how it would work:

 

web service1 bound to 192.168.0.1

web service2 bound to 192.168.0.2

web service3 bound to Any unbound address

 

Say you now require to re-configure web service2, so you stop it, re-configure it. Web service3 would capture the, the now available, IP address 192.168.0.2 and port number, resulting in an error when you attempt to restart web service2.

 

To avoid this error follow these steps:

  1. Stop web service3

  2. Restart web service2

  3. Restart web service3

 

This example uses Web Services, but is just as relevant to all services that you can create multiple instances of.