0

I'm doing a squid3.5 versions of the construction of the transparent proxy, squid3.5 version without the use of transparent to configure transparent proxy, my hosts file in Windows I'm going to visit your domain IP, this HTTP request will be forwarded to my VPS (113.10.222.53), and then use the iptables will port 80 redirect data to 3129, such function of proxy configuration is as follows:

  1. In centos6.4 configure, make, make install: I have added in the configure -- enable - Linux netfilter parameter

  2. The following is my profile: (3128 is a transparent proxy port, 3129 is a transparent proxy port, acl I allow all IP request broker)

.

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl all src 0.0.0.0/0   
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80      # http
acl Safe_ports port 21      # ftp
acl Safe_ports port 443     # https
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

# Recommended minimum Access Permission configuration:
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
# And finally deny all other access to this proxy
http_access allow all

# Squid normally listens to port 3128
http_port 3128
http_port 3129 intercept

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /usr/local/squid/var/cache/squid 100 16 256
cache_effective_user squid
# Leave coredumps in the first cache dir
coredump_dir /usr/local/squid/var/cache/squid

visible_hostname www.lecloud.com
# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:       1440    20% 10080
refresh_pattern ^gopher:    1440    0%  1440
refresh_pattern -i (/cgi-bin/|\?) 0 0%  0
refresh_pattern .       0   20% 4320
  1. Then I added the iptables rules, data port redirection will be 80 to 3129 port:(i have only one NIC(eth0))

    iptables -t NAT -a PREROUTING -s 0.0.0.0/0 -p TCP -- dport 80 - j REDIRECT - to - port 3129

  2. And then I modify the Windows modified access domain IP hosts file:

    113.10.222.53 www.ferryhalim.com

  3. Finally use firefox to access the results of this domain name: (error)

the flowing error was encountered while trying to retrieve the URL:http://www.er666.com connection to 113.10.222.53 failed the system returned:(111)connection refused the remote host or network may be down。please try the request again

  1. But in the browser to fill in the VPS IP and port 3128 to achieve the non-transparent proxy is a success

Hope to be able to help me!!

  • Is it actually listening to that port? Check with netstat -tnl | grep :3129 – wurtel Nov 12 '15 at 13:05
  • yes,i have done – Jingliu Man Nov 22 '15 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.