1.安装squid3
apt-get update
apt-get install squid
2.验证安装
squid3 -v
出现Squid Cache: Version 3.3.8,证明安装正确。
3.更改配置文件
gedit /etc/squid3/squid.conf
更改方法:
3.1 搜索acl CONNECT method CONNECT,在后面加入:
acl lanhome src 10.25.16.0/24
lanhome为名称,10.25.16.0/24是网段和掩码,表示10.25.16子网所有设备,可以通过此代理上网。
3.2 搜索http_access allow ,在后面加入:
http_access allow lanhome
3.3 注释http_access deny ... ,在前面加入#。
4 加载配置文件
squid3 -k reconfigure
在10.25.16网段的电脑,通过浏览器设置http代理,代理地址为设置squid的地址,端口为3128,即squid的默认端口。