squid简易配置透明代理

来源:互联网 发布:软件外包是什么意思 编辑:程序博客网 时间:2024/05/17 06:47
1、编辑配置文件/etc/squid/squid.conf
增加
acl localnet src 192.168.1.0/255.255.255.0
http_access allow localnet
visible_hostname squid.server.net
更改
http_port 3128

http_port 3128 transparent

2、初始化squid
squid -z

3、配置iptables
iptables -t nat -I PREROUTING -i eth0 -s 192.168.1.0/24 -p tcp --dport 80 -j REDIRECT --to-port 3128
0 0
原创粉丝点击