LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-15-2005, 09:38 AM   #1
saugato
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Rep: Reputation: 0
transperant proxy not working


Hi,

I have configured Squid PROXY and a iptables firewall. I want to configure a transparent proxy and route all my http requests via the squid. I have got hold of the following command to be added to my iptables rule set.


PLEASE SUGGEST ME.

Regards,

Saugato
 
Old 03-15-2005, 09:39 AM   #2
saugato
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Transperant proxy not working

contd.....
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
Will this work ?
I got a number of other commands like, from a site http://www.faqs.org/docs/Linux-mini/TransparentProxy.html#s3

* iptables -t mangle -A PREROUTING -j ACCEPT -p tcp --dport 80 -s squid-box
* iptables -t mangle -A PREROUTING -j MARK --set-mark 3 -p tcp --dport 80
* ip rule add fwmark 3 table 2
* ip route add default via squid-box dev eth1 table 2
I am confused. Please help. Saugato
 
Old 03-15-2005, 11:52 AM   #3
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Re: Transperant proxy not working

Quote:
Originally posted by saugato
contd.....
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
Will this work ?
That rule should work as long as eth0 is the internal interface that the traffic to be proxied is entering (in most circumstances this will actually be eth1). Make sure that squid is up and running as well.
 
Old 03-16-2005, 01:30 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
saugato, could you please provide an overview of your setup?? how many interfaces do you have?? how much NAT (Network Address Translation) are you doing?? etc... etc.. etc...

as Capt_Caveman pointed-out, you need to make sure the eth0 interface in your rule is the one facing your LAN...

also, remember that you'll need an INPUT rule to accept the packets that are getting redirected by the PREROUTING rule:

Code:
iptables -t nat -A PREROUTING -p TCP -i eth0 --dport 80 -j REDIRECT --to-ports 3128
iptables -A INPUT -p TCP -i eth0 --dport 3128 - j ACCEPT
or to be more politically correct:

Code:
iptables -t nat -A PREROUTING -p TCP -i eth0 --dport 80 -j REDIRECT --to-ports 3128
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p TCP -i eth0 --dport 3128 -m state --state NEW -j ACCEPT
don't forget you also need to deal with TCP port 443 (HTTPS) in order to allow browsing of secure websites... personally, i never use the proxy for HTTPS, i just NAT it...

just my two cents...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid in transperant mode. c0m4 Linux - Software 2 07-12-2005 04:50 AM
Netselect not working behind proxy WoofDeF Debian 1 06-24-2005 02:52 AM
Transperant Proxy and web server on one machine = issue ... sys7em Linux - Networking 2 06-16-2005 03:29 PM
iptables - proxy not working varun_saa Mandriva 1 04-28-2005 05:09 PM
YOU with Uni Proxy isn't working. Riddick Linux - Networking 5 10-01-2004 08:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration