LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Iptables to redirect outgoing http to another proxy ?

[ILUG] Iptables to redirect outgoing http to another proxy ?

Paul Jakma paul at clubi.ie
Fri Nov 19 16:21:58 GMT 2004


On Fri, 19 Nov 2004, Declan Grady wrote:

> Hi,

> Im running squid as a proxy server for my lan, I have a digiweb 
> satellite connection, which has a specific IP address & port number 
> which seems to be alot faster for browsing than doing a direct 
> onward connect on port 80 from squid.
>
> How can I use iptables to redirect my http traffic so that it uses 
> this IP address and port number, like a another proxy server ?

You can tell squid to use that other proxy:

cache_peer <proxy> parent <proxyport> 0 default

And you might want to set:

prefer_direct on

For iptables, I have the the following chain in my 'nat' table:

Chain trans-proxy (1 references)
target     prot opt source               destination
RETURN     tcp  --  anywhere             hibernia.jakma.org  tcp dpt:http
RETURN     tcp  --  anywhere             hibernia.jakma.org  tcp dpt:http
REDIRECT   tcp  --  anywhere             anywhere            tcp dpt:http redir ports 8080


And then have following in my PREROUTING chain (in nat table):

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
trans-proxy  all  --  anywhere             anywhere

regards,
-- 
Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
Fortune:
Law stands mute in the midst of arms.
 		-- Marcus Tullius Cicero



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell