Конфиг squid
Код: Выделить всё
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl our_networks src 192.168.1.0/24 192.168.2.0/24
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
acl timer_user src 192.168.1.79 192.168.1.20 192.168.1.21 192.168.1.22 192.168.1.23 192.168.1.72 192.168.1.95 192.168.1.96 192.168.1.97 192.168.1.87 192.168.1.70 192.168.1.37 192.168.1.34 192.168.1.33 192.168.1.35 192.168.1.36 192.168.1.30 192.168.1.74 192.168.1.62 192.168.1.63 192.168.1.102 192.168.1.60 192.168.1.59 192.168.1.28 192.168.1.29 192.168.1.61 192.168.1.32 192.168.1.31
#acl alexus src 192.168.1.3
#acl alexus_t time 07:50-22:00
acl timer_user_t time 07:50-17:30
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow timer_user timer_user_t
#http_access allow alexus alexus_t
http_access deny timer_user
#http_access deny alexus
http_access allow our_networks
http_access deny all
#http_reply_access allow all
icp_access allow all
http_port 192.168.1.15:3129 transparent
#always_direct allow all
never_direct allow all
cache_peer 192.168.200.52 parent 3128 3130 proxy-only no-query default
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
logformat traffpro %>a %<A %lp %st %ru
access_log /var/log/squid/access.log traffpro
#access_log /var/log/squid/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
visible_hostname sevalproxy
coredump_dir /var/spool/squidiptables-save -c
Код: Выделить всё
# iptables-save -c
# Generated by iptables-save v1.3.8 on Sun Dec 28 18:55:02 2008
*mangle
:PREROUTING ACCEPT [51682:19976188]
:INPUT ACCEPT [38203:9091602]
:FORWARD ACCEPT [20569:11913750]
:OUTPUT ACCEPT [28014:10193968]
:POSTROUTING ACCEPT [45021:21893579]
[959:176921] -A PREROUTING -d 192.168.1.0/255.255.255.0 -p tcp -m tcp --dport 80 -j ACCEPT
[10:599] -A PREROUTING -s 192.168.1.0/255.255.255.0 -p tcp -m tcp --dport 80 -j QUEUE
[7160:905310] -A PREROUTING -s 192.168.1.0/255.255.255.0 -p tcp -m tcp --dport 3129 -j QUEUE
[0:0] -A PREROUTING -d ! 192.168.1.15 -i eth0 -p tcp -m tcp --dport 80 -j QUEUE
COMMIT
# Completed on Sun Dec 28 18:55:02 2008
# Generated by iptables-save v1.3.8 on Sun Dec 28 18:55:02 2008
*filter
:INPUT ACCEPT [31864:8223083]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [20848:4458896]
[6170:857515] -A INPUT -s 192.168.1.0/255.255.255.0 -p tcp -m tcp --dport 3129 -j ACCEPT
[174:14100] -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
[0:0] -A FORWARD -d 192.168.1.15 -i eth1 -p tcp -m tcp --dport 8080 -j ACCEPT
[17669:11404476] -A FORWARD -j QUEUE
[6742:5583564] -A OUTPUT -s 192.168.1.15 -d 192.168.1.0/255.255.255.0 -p tcp -m tcp --sport 3129 -j QUEUE
[270:129680] -A OUTPUT -d 192.168.1.0/255.255.255.0 -p tcp -m tcp --sport 3129 -j QUEUE
[158:24976] -A OUTPUT -p tcp -m tcp --sport 22 -j ACCEPT
COMMIT
# Completed on Sun Dec 28 18:55:02 2008
# Generated by iptables-save v1.3.8 on Sun Dec 28 18:55:02 2008
*nat
:PREROUTING ACCEPT [6178:383928]
:POSTROUTING ACCEPT [23:5716]
:OUTPUT ACCEPT [136:12724]
[68:3536] -A PREROUTING -s 192.168.1.0/255.255.255.0 -d 192.168.1.15 -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
[0:0] -A PREROUTING -s 192.168.1.0/255.255.255.0 -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3129
[3:144] -A PREROUTING -d 10.64.86.20 -p tcp -m tcp --dport 8080 -j DNAT --to-destination 192.168.1.3:8080
[214:12001] -A POSTROUTING -o eth1 -j SNAT --to-source 10.64.86.20
COMMIT
# Completed on Sun Dec 28 18:55:02 2008У Траффпро есть конфиг в котром прописанно перенаправление траффика на сквид
/etc/traffpro/traffpro_rule.cfg
Код: Выделить всё
#Заворачиваем на SQUID
iptables -t mangle -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -d ! 192.168.1.15 -j QUEUE
iptables -I OUTPUT 1 -p tcp -m tcp -s 192.168.1.15 --sport 3129 -d 192.168.1.0/24 -j QUEUE
iptables -t nat -A PREROUTING -i eth0 -p tcp -s 192.168.1.0/24 -d 192.168.1.15 --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp -s 192.168.1.0/24 --dport 80 -j REDIRECT --to-ports 3129
# Правила который созданны TRAFFPRO squid
#iptables -t mangle -A PREROUTING -p tcp --dport 80 -d 192.168.1.0/255.255.255.0 -j ACCEPT
#iptables -t mangle -A PREROUTING -s 192.168.1.0/255.255.255.0 -p tcp --dport 80 -j QUEUE
#iptables -t mangle -A PREROUTING -s 192.168.1.0/255.255.255.0 -p tcp --dport 3129 -j QUEUE
#iptables -t nat -A PREROUTING -m tcp -p tcp -s 192.168.1.0/255.255.255.0 -d ! 192.168.1.0/255.255.255.0 --dport 80 -j REDIRECT --to-ports 3129
#iptables -A INPUT -s 192.168.1.0/255.255.255.0 -m tcp -p tcp --dport 3129 -j ACCEPT
#iptables -A OUTPUT -p tcp -d 192.168.1.0/255.255.255.0 --sport 3129 -j QUEUE
#Проброс порта 8080 на UserGate
iptables -t nat -A PREROUTING -p tcp -d 10.64.86.20 --dport 8080 -j DNAT --to-destination 192.168.1.3:8080
iptables -A FORWARD -i eth1 -d 192.168.1.15 -p tcp --dport 8080 -j ACCEPT
#Позволит не потерять контроль над сервером при включенной защите сервера
iptables -A INPUT -m tcp -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -m tcp -p tcp --sport 22 -j ACCEPTeth0 - внутренняя
eth1 - внешняя
Подскажите почему не работает перенаправление трафика на squid?
