Здравствуйте, я новичок, только начинаю изучение Unix систем, столкнулся с такой проблемой, установил сервер UBUNTU Server 12.04.5, настроил squid3:
# 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
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 192.168.31.0/24 # RFC1918 possible internal network
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
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
http_access allow localnet
http_access allow localhost
http_access deny all
# Squid normally listens to port 3128
http_port 192.168.31.1:3128 intercept
#Default:
cache_mem 1024 MB
#Default:
maximum_object_size_in_memory 512 KB
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid3 2048 16 256
#Default:
maximum_object_size 4 MB
access_log /var/log/squid3/access.log squid
#Default:
logfile_rotate 31
# 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 (Release|Packages(.gz)*)$ 0 20% 2880
# example lin deb packages
#refresh_pattern (\.deb|\.udeb)$ 129600 100% 129600
refresh_pattern . 0 20% 4320
В iptables завернул все на squid3:
#!/bin/sh
#Включаем форвардинг пакетов
echo 1 > /proc/sys/net/ipv4/ip_forward
#Разрешаем траффик на lo
iptables -A INPUT -i lo -j ACCEPT
#Разрешаем доступ из внутренней сети наружу
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
#Включаем NAT
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.31.0/24 -j MASQUERADE
#Разрешаем ответы из внешней сети
iptables -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
#Запрещаем доступ снаружи во внутреннюю сеть
iptables -A FORWARD -i eth0 -o eth1 -j REJECT
# Заворачиваем http на прокси
iptables -t nat -A PREROUTING -i eth1 ! -d 192.168.31.0/24 -p tcp -m multiport --dport 80,8080 -j DNAT --to 192.168.31.1:3128
Все вроде заработало, но клиенты могут заходить на сайты только по https, по http страницы не доступны