Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-16-2008, 05:03 AM
O.R.Senthil Kumaran
 
Posts: n/a
Trying to setup a Proxy server - on local machine

Hello,
I have a machine which connects directly to internet using ADSL Modem.
Operating System is Fedora Core 2.
I want to setup a squid proxy server to test certain scenarios for a
bug-fix I am working on.
Squid version in my system is Version 2.5.STABLE6

Following is my squid configuration:
----
http_port 3128
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_dir ufs /var/spool/squid 100 16 256
cache_access_log /var/log/squid/access.log
client_netmask 255.255.255.0
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl intranet src 192.168.1.0/24
cache_dir null /tmp
http_access allow intranet
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_reply_access allow all
icp_access allow all
visible_hostname goofy.goofy.com
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
coredump_dir /var/spool/squid
---

With this configuration, I am able to Proxy + Cache the requests when
Browser is set to goofy.goofy.com:3128 ( My local machine, that is the
same machine).

But my problem is, I am able to directly connect to Internet also.
BOTH are working!
I want the connection to Internet happen only through Proxy. I don't
want Direct Internet connection to work. How do I do that?

I also tried the suggestions with iptables mentioned here:
http://www.cyberciti.biz/tips/linux-...uid-howto.html
But that did not help.

Any suggestions?

Thanks,
Senthil


Reply With Quote
  #2 (permalink)  
Old 08-16-2008, 11:42 AM
Pascal Hambourg
 
Posts: n/a
Re: Trying to setup a Proxy server - on local machine

Hello,

O.R.Senthil Kumaran a écrit :
> Hello,
> I have a machine which connects directly to internet using ADSL Modem.
> Operating System is Fedora Core 2.
> I want to setup a squid proxy server to test certain scenarios for a
> bug-fix I am working on.

[...]
> With this configuration, I am able to Proxy + Cache the requests when
> Browser is set to goofy.goofy.com:3128 ( My local machine, that is the
> same machine).
>
> But my problem is, I am able to directly connect to Internet also.
> BOTH are working!


Of course.

> I want the connection to Internet happen only through Proxy. I don't
> want Direct Internet connection to work. How do I do that?


So you want squid to act as a transparent proxy for locally generated
HTTP connections.

> I also tried the suggestions with iptables mentioned here:
> http://www.cyberciti.biz/tips/linux-...uid-howto.html
> But that did not help.


This page describes the setup for a transparent proxy on the gateway,
not on the local host. You need iptables to redirect local outgoing HTTP
connections, except those coming from the proxy itself (otherwise it'll
cause an endless loop).

iptables -t nat -A OUTPUT -p tcp --dport 80 \
-m owner ! --uid-owner <squid> -j REDIRECT --to-port 3128

or maybe

iptables -t nat -A OUTPUT -p tcp --dport 80 \
-m owner ! --uid-owner <squid> -j DNAT --to goofy.goofy.com:3128

where <squid> must be replaced with the owner of the squid process. Note
that neither the user nor the process may be named "squid".
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:04 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Mortgage Calculator | Refinance | Advertising | Gas Suppliers | Mortgage Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114