Deploy SQUID as Transparent Proxy Server on CentOS 6.4

General discussion about Linux, Linux distribution, using Linux etc.
Post Reply
starboy
Cadet
Posts: 10
Joined: Thu Nov 13, 2003 9:30 am
Location: pk
Contact:

Deploy SQUID as Transparent Proxy Server on CentOS 6.4

Post by starboy »

Hi to all,
well I am new bie here I want to deploy squid as transparent proxy server I've followed many tutorials but unable to find teh solution for my problem. I mean I am able to brows the internet on client machine but I've to setup proxy server addres on my browser and I also want to use outlook express to send and recieve mail but I coundn't letme shwo you my configuration.

DEVICE=eth0
HWADDR=00:27:0E:23:E3:E8
TYPE=Ethernet
UUID=94f80279-f5e2-42d4-ab0f-a58a10a5c6d8
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.1.51
NETMASK=255.255.255.0
GATEWAY=192.168.1.
---------------------------------------

DEVICE=eth1
HWADDR=00:0D:88:F7:66:55
TYPE=Ethernet
UUID=9cd8c9f5-a61e-4e0b-9e57-2b8b0b705d7a
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.0.253
NETMASK=255.255.255.0
-------------------------------------
/etc/squid/squid.conf

#
# Recommended minimum configuration:
#
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl asg src 192.168.0.0/24
acl blocked_site url_regex -i src "/etc/squid/blocked_site.conf"
http_access deny blocked_site
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
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:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager

# 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

# 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
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost


# And finally deny all other access to this proxy
http_access deny all
http_access allow asg



# Squid normally listens to port 3128
http_port 3128 intercept

# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

# 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
visible_hostname asg.proxy.srv
---------------------------------------------
iptables configuration

# Generated by iptables-save v1.4.7 on Mon Jun 3 16:59:37 2013
*nat
:PREROUTING ACCEPT [886:92870]
:POSTROUTING ACCEPT [10:1367]
:OUTPUT ACCEPT [8:521]
-A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.0.253:3128
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
COMMIT
# Completed on Mon Jun 3 16:59:37 2013
# Generated by iptables-save v1.4.7 on Mon Jun 3 16:59:37 2013
*filter
:INPUT ACCEPT [161:46738]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [7928:10036929]
-A INPUT -s 192.168.0.0/24 -p tcp -m tcp --dport 3128 -j ACCEPT
-A INPUT -s 192.168.0.0/24 -j ACCEPT
-A FORWARD -s 192.168.0.0/24 -i eth1 -j ACCEPT
COMMIT
# Completed on Mon Jun 3 16:59:37 2013
-------------------------------
/etc/resolve.conf

# Generated by NetworkManager


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 8.8.8.8
-------------------------------------
/etc/networks

default 0.0.0.0
loopback 127.0.0.0
link-local 169.254.0.0
----------------------------------------
/etc/hosts
127.0.0.1 asg.proxy.srv localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
----------------------------------------
cat /proc/sys/net/ipv4/ip_forward
1
----------------------------------------

what information else you need to fix my problem? please letme know.

what I want??
I want to browse internet on client machine without setting proxy in the above stated scenario I am able to use internet on all clients successfully but with the setting of proxy on browser.I've tried to give the gateway(192.168.0.253) on my clients but no way.I also want to send and recieve mails via outlook express POP3. I cant I mean I am unable to do so. please guide me how to set it up?
I can provide all info you need to set it up please help me.
STARBOY
Post Reply