Solved

Transparent proxy clients  & nameservers

Posted on 2003-12-07
7
373 Views
Last Modified: 2010-03-18

I have a working transparent proxy using squid and iptables. (RedHat 9.0)
If I put an ip address in the client web browser it works.
Names do not work so apparently the web browser cannot find the nameservers squid is using.

If I put the squid box in the web browser as a proxy it works with names.

How can I get this to work transparently with names???
0
Comment
Question by:Ted22
  • 4
  • 3
7 Comments
 
LVL 4

Expert Comment

by:Jivko
ID: 9895263
On the router:
"Mark" packets of destination port 80 with value 2

router# iptables -A PREROUTING -i eth0 -t mangle -p tcp --dport 80 \
 -j MARK --set-mark 2
            

Setup iproute2 so it will route packets with "mark" 2 to squid-box

router# echo 202 www.out >> /etc/iproute2/rt_tables
router# ip rule add fwmark 2 table www.out
router# ip route add default via 10.0.0.2 dev eth0 table www.out
router# ip route flush cache
            
#stop ICMP redirects
naret# echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects
naret# echo 0 > /proc/sys/net/ipv4/conf/default/send_redirects
naret# echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects

http://www.lartc.org/lartc.html#LARTC.COOKBOOK.SQUID


On the squid box:
squid-box# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

And finaly squid.conf:

httpd_accel_host virutal
httpd_accel_port 80
httpd_accel_uses_host_header on
httpd_accel_with_proxy on

Regards









0
 
LVL 1

Author Comment

by:Ted22
ID: 9895443
They don't let me configure the router and my squid box is configured correctly.

Does that mean I can't do this?
0
 
LVL 4

Accepted Solution

by:
Jivko earned 125 total points
ID: 9895644
So .... how did you made the proxy "transparent" if you can not touch the router ????
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:Ted22
ID: 9895891
The router is on the other side of the squid box.
To make this sound stranger, the router is behind a firewall.
It's magic as far as I know.

The squid box gets it's address from a DHCP server.
The proxy is transparent as long as the squid box is the gateway on the client.
(It works with IP addresses, but not names.)








0
 
LVL 4

Expert Comment

by:Jivko
ID: 9896545
1. Do you have working DNS? ( Check your resolv.conf on the squid box)
2.Did you put this:
squid-box# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
at squid box?

3.Did you put this:
httpd_accel_host virutal
httpd_accel_port 80
httpd_accel_uses_host_header on
httpd_accel_with_proxy on

in your squid.conf

?

0
 
LVL 1

Author Comment

by:Ted22
ID: 9909501

I double checked all those things .

Maybe I have something in one of those files that's not supposed to be there.

0
 
LVL 1

Author Comment

by:Ted22
ID: 9916700
After looking at the Masquerade HOWTO it said that you must put the name server addresses on the client
if it won't find them. Why it would work sometimes and not others it didn't say. I'll accept one of your comments as an answer because everything you said was correct.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
USPS intelligent mail barcode font 11 136
Samba Security Improvement for Writable Directories 8 67
Help instaling linux on vmware 36 85
iptables ubuntu BLOCK all 2 83
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question