LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 760|回复: 3

我想用SQUID做透明代理,出现这样的问题,请高手过来看看

[复制链接]
发表于 2003-8-9 20:38:13 | 显示全部楼层 |阅读模式
RH 9
eth0:192.168.0.8
我用的是杭州网通,通过拨号出去的:
这是我的squid.conf 配置文件:


http_port 192.168.0.8:3128
cache_mem 32 MB
cache_swap_low 90
cache_swap_high 95
cache_mgr cool@cool.com
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80                # http
acl Safe_ports port 21                # ftp
acl Safe_ports port 443 563        # https, snews
acl Safe_ports port 70                # gopher
acl Safe_ports port 210                # wais
acl Safe_ports port 1025-65535        # unregistered ports
acl Safe_ports port 280                # http-mgmt
acl Safe_ports port 488                # gss-http
acl Safe_ports port 591                # filemaker
acl Safe_ports port 777                # multiling http
acl CONNECT method CONNECT

acl  good  src  192.168.0.1-192.168.0.50/24
acl all src 0.0.0.0/0

http_access allow good
http_access deny all



客户端在IE 里设置代理服务器:192.168.0.8:3128 可以访问internet,QQ,MSN同样设置,也可以上,现在就是想不用这样设,实现透明代理。
运行: iptables -A PREROUTING -t nat -i eth0 -p tcp --dpor 80 -j REDIRECT --to-port 3128
出现这样提示:iptables: No chain/target/match by that name
这是什么问题,我该怎么做?


还有就是,我在/etc/rc.d/rc.local加入下面几行想实现透明代理,结果没办法实现:
echo 1 > /proc/sys/net/ipv4/ip_forword
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o ppp0 -j MASQUERADE

我这样设置有什么问题吗?
发表于 2003-8-9 22:35:07 | 显示全部楼层

加载iptable模块

modprobe ip_tables
modprobe iptable_filter
modprobe iptable_nat
发表于 2003-8-11 11:23:16 | 显示全部楼层
好像应该是--dport吧!!!你写少了一个"t"
发表于 2003-8-11 18:13:16 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表