LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-23-2005, 06:35 AM   #1
usmanmehmood
LQ Newbie
 
Registered: Sep 2005
Posts: 15

Rep: Reputation: 0
Configuring tranparent proxy with squid and iptables


Hi
I want to configure transparent proxy using squid and iptables on Redhat 9.0. Currently I am using Redhat 7.3 (squid and iphains).
I have configured router to route www requets to proxy server (ip policy route-map ). I edit file /etc/sysconfig/ipchains to configure it. My configuration for ipchains is:

# Firewall configuration written by lokkit
# Manual customization of this file is not recommended.
# Note: ifup-post will punch the current nameservers through the
# firewall; such entries will *not* be listed here.
:input ACCEPT
utput ACCEPT
:forward ACCEPT
-A input -p tcp -s 0/0 -d 0/0 80 -j REDIRECT 8080
-A input -p tcp -s 0/0 -d x.x.x.x/y.y.y.y 80 -j ACCEPT

(x.x.x.x is the network in which our servers are i.e, proxy, ras, router etc and y.y.y.y is its subet).

Can anyone help me in configuring iptables in similar way for transparent proxy.

Thanks
 
Old 09-23-2005, 10:18 PM   #2
roopunix
Member
 
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208

Rep: Reputation: 30
Have a Look At this

http://www.linuxquestions.org/questi...hreadid=350973
 
Old 09-23-2005, 11:59 PM   #3
usmanmehmood
LQ Newbie
 
Registered: Sep 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks dear

but the problem is that i have only one eth interface "eth0". should i use PREROUTING and POSTROUTING on that signle interface. i mean is it possible or i have to add another interface. if i add an interface i must use another ip and i am already running out of ips. i havn't got anyother live ip.

should i use:

sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
/sbin/iptables -t nat -A POSTROUTING -s x.x.x.x/y.y.y.y -o eth0 -j MASQUERADE
eth0

is it possible.

Thanks again.
 
Old 09-24-2005, 12:18 AM   #4
roopunix
Member
 
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208

Rep: Reputation: 30
I have'nt tried with a single NIC.But logically it should be possible.Try it out!!!!!!!!!!
 
Old 09-24-2005, 05:57 AM   #5
usmanmehmood
LQ Newbie
 
Registered: Sep 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks dear
my problem solved.
iwas trying to configure iptables for last one year.
thanks a lot.
a little prob is that when i restart iptables config is lost.
i tried command iptables-save but it hadn't worked.
how to solve this problem?



THANKS AGAIN
 
  


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
Using iptables to bypass squid proxy for a specific domain jcopley Linux - Security 4 05-26-2015 12:38 PM
Proxy won't let me connect, iptables, squid and dansguardian hindenbergbaby Linux - Networking 4 12-02-2009 03:45 AM
Configuring Outlook Express through squid proxy kaebsh Linux - Networking 2 04-11-2007 02:31 AM
Need Help Regarding the Tranparent Proxy ....if sm1 can then i will be thankful sarbazcables Linux - Networking 0 09-13-2003 08:27 AM
configuring squid for ftp proxy? sparsh Linux - Software 0 04-09-2003 08:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:10 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