linux搭建squid正向代理

1.安装squid

yum install -y squid 

2.编辑squid配置文件

vim /etc/squid/squid.conf 
添加
acl local src 0.0.0.0/24       #允许0.0.0.0/24网段内所有客户机访问代理服务器
http_access allow local       #该记录一定要添在deny all之前,允许本地访问

在这里插入图片描述
在这里插入图片描述
3.启动squid服务

systemctl start squid 
systemctl enable squid 

4、测试
1.linux客户端配置正向代理

export http_proxy=http://10.30.3.30:3128 #192.9.191.30是代理服务器ip,http
export https_proxy=http://10.30.3.30:3128 #https

echo "export http_proxy=http://10.30.3.30:3128" >>/etc/profile
echo "export https_proxy=http://10.30.3.30:3128" >>/etc/profile
source /etc/profile
yum -y install httpd
wget https://codeload.github.com/gflags/gflags/tar.gz/v2.1.2

在这里插入图片描述
2、谷歌测试

在这里插入图片描述
点击设置
在这里插入图片描述

在这里插入图片描述
访问百度成功

在这里插入图片描述

发布了144 篇原创文章 · 获赞 252 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/a13568hki/article/details/103955331