黄色标记部分一定要注意了,不一定是client的ip,有可能是NAT后的地址,比如192.168.1.0/24网段到172.29.1.157squid服务端的时候,最开始配置的是
192.168.0.0/16 错误一直检查不出来。ssh 上squid服务器端上之后,通过last命令查看ip 地址为172.29.0.1
最好是加上0.0.0.0 要不有可能端口会起在tcp6上面
[root@iZuf6bj2wp0grcuw8kb92mZ squid]# cat /etc/squid/squid.conf
http_port 0.0.0.0:3128
acl manager proto cache_object
acl localnet src 172.29.0.0/16 # RFC1918 possible internal network
acl SSL_ports port 443
acl Safe_ports port 80 8080
acl Safe_ports port 21
acl Safe_ports port 443
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access allow all
export http_proxy=http://172.29.1.157:3128
squid服务端的一些日志
[root@iZuf6bj2wp0grcuw8kb92mZ squid]# tail -f /var/log/squid/access.log
1501644475.749 594 172.29.0.1 TCP_MISS/200 195600 GET http://mirror.bit.edu.cn/centos/7.3.1611/extras/x86_64/repodata/c96c88b1951d0f4ec564818a23b501916d3762f755e77c7d0bd2c3e3136a6b63-primary.sqlite.bz2 - HIER_DIRECT/202.204.80.77 application/octet-stream
1501644522.849 47694 172.29.0.1 TCP_MISS_ABORTED/200 1802695 GET http://mirrors.cqu.edu.cn/CentOS/7.3.1611/updates/x86_64/repodata/33fdce604445f67a26ce5ddc354ea0c835ed119ac8cb7404cc2b565bf80722a1-primary.sqlite.bz2 - HIER_DIRECT/202.202.1.140 application/octet-stream
1501644570.914 10533 172.29.0.1 TCP_MISS/200 13824 GET http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm - HIER_DIRECT/162.243.159.138 application/x-redhat-package-manager
1501644659.308 584 172.29.0.1 TCP_MISS/200 1382 GET http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/repodata/repomd.xml - HIER_DIRECT/162.243.159.138 application/xml
1501644659.881 525 172.29.0.1 TCP_MISS/200 1382 GET http://repo.zabbix.com/non-supported/rhel/7/x86_64/repodata/repomd.xml - HIER_DIRECT/162.243.159.138 application/xml
1501644660.391 414 172.29.0.1 TCP_MISS/200 2085 GET http://repo.zabbix.com/non-supported/rhel/7/x86_64/repodata/primary.xml.gz - HIER_DIRECT/162.243.159.138 application/x-gzip
1501644660.720 743 172.29.0.1 TCP_MISS/200 17626 GET http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/repodata/primary.xml.gz - HIER_DIRECT/162.243.159.138 application/x-gzip
1501644799.739 138471 172.29.0.1 TCP_MISS_ABORTED/206 2196104 GET http://mirrors.cqu.edu.cn/CentOS/7.3.1611/updates/x86_64/repodata/33fdce604445f67a26ce5ddc354ea0c835ed119ac8cb7404cc2b565bf80722a1-primary.sqlite.bz2 - HIER_DIRECT/202.202.1.140 application/octet-stream
1501644863.741 21342 172.29.0.1 TCP_MISS/206 4222582 GET http://mirrors.sohu.com/centos/7.3.1611/updates/x86_64/repodata/33fdce604445f67a26ce5ddc354ea0c835ed119ac8cb7404cc2b565bf80722a1-primary.sqlite.bz2 - HIER_DIRECT/221.236.12.140 application/octet-stream
1501644883.441 1813 172.29.0.1 TCP_MISS/200 353670 GET http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-agent-3.2.7-1.el7.x86_64.rpm - HIER_DIRECT/162.243.159.138 application/x-redhat-package-manager