|
linux下使用squid设置代理成功,但有些问题希望高手帮忙解决一下
我下载了squid的2.5版本,然后安装设置完成
启动后客户机能通过3128端口代理上网,但现在还是不能实现透明代理
我的squid.conf文件配置如下:
http_port 3128
acl rule1 url_regex sex
acl rule2 url_regex game
http_access deny rule1
http_access deny rule2
http_access allow all
# 启用透明代理
http_accel_host virtual
http_accel_port 80
http_accel_with_proxy on
http_accel_uses_host_header on
网络配置为双网卡eth0为adsl固定ip网关和dns.ip均为电信提供的,eth1为局域网网卡,ip192.168.0.1
firewall文件内容为:
#!/bin/sh
echo "Enable IP Forwarding...."
echo "1">/proc/sys/net/ipv4/ip_forward
echo "Starting iptables rules..."
/sbin/modprobe iptable_filter
/sbin/modprobe ip_tables
/sbin/modprobe iptable_nat
#Refresh all chains
/sbin/iptables -F -t nat
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to a.b.c.d
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
为何不能实现nat透明代理?????????? |
|