首页 > 其他 > 详细

squid 代理

时间:2019-09-07 15:28:31      阅读:112      评论:0      收藏:0      [点我收藏+]

参考网址:
https://www.cnblogs.com/lovelinux199075/p/9062345.html
https://www.chenyudong.com/archives/squid-forward-proxy.html
https://blog.csdn.net/m0_37997046/article/details/83903356

一、代理服务器配置

1.安装squid
$ yum install squid -y

2.编辑squid配置文件
$ vim /etc/squid/squid.conf

acl local src 192.9.191.0/24 //允许192.9.191.0/24网段内所有客户机访问代理服务器
http_access allow localnet //该记录一定要添在deny all之前
http_port 3128 

3.防火墙配置
$ systemctl stop firewald.service
$ systemctl disable firewald.service
$ yum install iptables-services iptables-devel -y
$ systemctl enable iptables.service
$ systemctl start iptables.service
$ iptables -I INPUT 1 -s 192.9.191.0/24 -p tcp --dport 3128 -j ACCEPT
$ iptables -I INPUT 2 -p tcp --dport 3128 -j DROP

4.启动squid服务
$ systemctl start squid
$ systemctl enable squid

二、linux客户端配置

1.linux客户端配置正向代理
$ export http_proxy=http://192.9.191.30:3128 \192.9.191.30是代理服务器ip
$ export https_proxy=http://192.9.191.30:3128
$ echo "export http_proxy=http://192.9.191.30:3128" >>/etc/profile
$ echo "export https_proxy=http://192.9.191.30:3128" >>/etc/profile

2.测试http
$ wget http://www.cmake.org/files/v3.3/cmake-3.3.1.tar.gz

3.代理服务器上查看日志/var/log/squid/access.log

4.测试https
$ wget https://codeload.github.com/gflags/gflags/tar.gz/v2.1.2

5.在代理服务器上查看日志/var/log/squid/access.log

三、windows客户端设置,以搜狗浏览器演示

测试http和https查看日志

squid 代理

原文:https://www.cnblogs.com/lizidong/p/11480489.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!