Portal Home > Knowledgebase > Articles Database > CentOS 5.8 + Squid 3 - Changing Outoing IP Address Issues


CentOS 5.8 + Squid 3 - Changing Outoing IP Address Issues




Posted by RapidGravy, 06-20-2012, 02:29 PM
Hello, Im using the latest version of Squid 3.1.8 listening on port 3222 and i have everything setup properly and it appears to be working as expected. Im able to get my browser to connect through the Proxy and work normally, though i can't seem to be able to change the IP Squid uses for outgoing connections. My server is running CentOS 5.8 with cPanel 11.32 Aside from the main server IP i have 18 other external IP addressed properly configured to the server. For example lets say my main server IP is 1.1.1.1 and the other IP addresses are 2.2.2.2 - 2.2.2.19 So currently when i set my browsers proxy setting to use 1.1.1.1:3222 im able to connect through the proxy properly and when i go to any WhatismyIP website it shows that i in fact my IP is 1.1.1.1. Now im wanting to change the outgoing IP Squid uses to 2.2.2.19. Reading online i found that i should be using "tcp_outgoing_address" so in my Squid.conf file i have setup "tcp_outgoing_address 2.2.2.19" and saved and restarted Squid. Now when i point my browser to 1.1.1.1:3222 and connect everything seems to be working as normal but if i check my external IP it is still 1.1.1.1 and not 2.2.2.19. Im even able to tell my browser to connect to 2.2.2.19:3222 and i successfully connect but while viewing my IP address with a WhatismyIP website it still is showing that my IP is the main server ip 1.1.1.1 Though here is where things get confusing (to me anyways), If i view a whatismyIP website i always see the main server ip 1.1.1.1. But if i view a page hosted on my server that shows my ip (such as a 404 page i have setup with "") it shows the IP 2.2.2.19. So outside the server websites see me as the main server IP but a site within the server shows the IP im wanting Squid to use as the external. How can i change the external IP squid uses so i would be able to connect and point my browse to use 1.1.1.1:3222 (What squid is listening on) and browse websites using the IP 2.2.2.19 ? Here is my Squid.conf file, i have edited my real IPs to the Example IPs i have stated above. You can see at the bottom where i use "tcp_outgoing_address"



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read