I have a CentOS 6 box running Squid and Privoxy to create a custom proxy setup. The server has several public IPv4 addresses configured on virtual eth0 interfaces.

My Goal:

I want to send all proxy traffic through a specific IPv4 address that is setup on the server, but is not the default IP.


All proxy traffic is being sent through the default IP of the eth0 interface. I don't want this IP to be used.


I am using both Squid and Privoxy in my proxy.


My squid install is configured on an external IPv4 address http_port x.x.x.x:8080and is what a client uses to connect to the proxy.

Squid is using cache_peer to connect to a local Privoxy server running on the same server.


Privoxy is setup as local only and has a listen-address of [::1]:8118 and (localhost only). Privoxy does further filtering, that Squid otherwise cannot do.

Privoxy does not do any additional forwarding but filters and modifies header information.

What I've tried:

I tried using tcp_outgoing_address x.x.x.x in Squid, however this causes a "Zero Sized Reply" error when applied in the config. This is because of Privoxy being involved in the chain. If I removed Privoxy from the chain it works. Similarly I used POSTROUTING with iptables and got the same error trying to change the source IP.

I would like assistance in finding a working solution to get my proxy traffic routed through a user specified IPv4 address, with Squid and Privoxy connected together. I am open to any setup changes required for this to work.


  • I found my proxy chain is the issue. I have added more information and revised my original question. Jun 15, 2015 at 20:18

1 Answer 1


I decided that Privoxy was the main issue and decided to use SquidGuard instead, by removing Privoxy from the chain I was able to use tcp_outgoing_address as required.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .