squid will not listen on specific IP

Posted by Chris on Server Fault See other posts from Server Fault or by Chris
Published on 2012-12-01T00:31:44Z Indexed on 2012/12/01 5:06 UTC
Read the original article Hit count: 456

Filed under:

I have a public subnet with squid installed.

Let's say my subnet is from 1.2.3.2 to 1.2.4.254.

When I set the following:

http_port 50000
http_port 1.2.3.2:50000

it is working.

But when I set:

http_port 1.2.4.37:50000

it is not working.

It is only working with my first public IP from my subnet.

The error I get when it is not working is the following:

commBind: Cannot bind socket FD 10 to 1.2.4.37:50000: (99) Cannot assign requested address

What is wrong with my configuration?

@Zoredache

I have a dedicated server and the whole subnet is defined as IP Range. When I use only the port or the first IP and doing

netstat -ntlp | grep  46555

I get the following:

tcp        0      0 0.0.0.0:50000           0.0.0.0:*               LISTEN      25532/(squid        )

When I use my specific IP, then the netstat query will show nothing, as the server does not start. I don't want squid to listen on all or the first IP, it is just a specific one it should listen to.

© Server Fault or respective owner

Related posts about squid