Configure Multiple IP for Squid Proxy Server & hide Version and Hostname

Proxy server is a computer system or application which is installed on computer system that works as a  acts as an agent or channel for requests from clients looking for resources from other servers. You can check see this post for more information about installation and configuration of Squid Proxy.

Now after installation when you try to check your IP in any site like whatismyip.com it will show that you are using proxy along with the hostname and version of Squid proxy server which is a security concern.

1) Hide Proxy version & server hostname


a) Hide Squid Version

open “/etc/squid/squid.conf” in a editor like vim and search for “httpd_suppress_version_string” and enable it.

Change FROM:

#  TAG: httpd_suppress_version_string   on|off
#       Suppress Squid version string info in HTTP headers and HTML error pages.
#
#Default:
#httpd_suppress_version_string off

TO:

#  TAG: httpd_suppress_version_string   on|off
#       Suppress Squid version string info in HTTP headers and HTML error pages.
#
#Default:
httpd_suppress_version_string on


b) Hide Hostname

Search for “visible_hostname” and change FROM:

#  TAG: visible_hostname
#       If you want to present a special hostname in error messages, etc,
#       define this.  Otherwise, the return value of gethostname()
#       will be used. If you have multiple caches in a cluster and
#       get errors about IP-forwarding you must set them to have individual
#       names with this setting.
#
#Default:
# none

TO:

#  TAG: visible_hostname
#       If you want to present a special hostname in error messages, etc,
#       define this.  Otherwise, the return value of gethostname()
#       will be used. If you have multiple caches in a cluster and
#       get errors about IP-forwarding you must set them to have individual
#       names with this setting.
#
#Default:
visible_hostname <your desired hostname>

<your desired hostname> will be the name you want to show to world


2) Configure Multiple IP for Squid

Sometime it happens that the Proxy server which you have setup have multiple IP address and you want to configure squid server to use multiple IP addresses (i.e. Systems will show the secondary IP of the server instead of primary). Open squid configuration file; search for “tcp_outgoing_address” and add following

acl ip1 myip <IP Address 1>
acl ip2 myip <IP Address 2>
tcp_outgoing_address <IP Address 1> ip1
tcp_outgoing_address <IP Address 2> ip2

Replace <IP Address> with the IP assigned to your Proxy Server.

Restart Squid Server with command “service squid restart

About: Mike

Milind Koyande loves to work on new technologies specially virtualization and troubleshoot server problems. I’m an avid photographer and love to spend my free time close to nature, trying to capture its glory on my camera.


2 thoughts on “Configure Multiple IP for Squid Proxy Server & hide Version and Hostname”

This site uses Akismet to reduce spam. Learn how your comment data is processed.