Chinaunix

标题: 请教透明代理中的问题 [打印本页]

作者: xiaosan168    时间: 2004-08-01 20:13
标题: 请教透明代理中的问题
通过3128代理可以上HTTP
在以下中已经打开了透明代理
squid.conf :
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
在rc.local中也把端口重向指定了3128,但是透明代理无法生效。
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128

求各位高手指教!!!
作者: szkingrose    时间: 2004-08-02 07:52
标题: 请教透明代理中的问题
echo 1 >;  /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -j MASQUERADE
作者: xiaosan168    时间: 2004-08-02 12:36
标题: 请教透明代理中的问题
原帖由 "szkingrose" 发表:
echo 1 >;  /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -j MASQUERADE

这个是用来做nat转发的。
我的问题是:通过squid代理来上网,但是把80端口的包转发给3128端口不行呀。不知问题在那里呀。
作者: szkingrose    时间: 2004-08-02 17:12
标题: 请教透明代理中的问题
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
试试!
作者: xiaosan168    时间: 2004-08-03 10:18
标题: 请教透明代理中的问题
to szkingrose
谢谢你的帮助,我的问题解决了!
好像加了/sbin/modprobe ip_conntrack_irc
端口转发就正常了
作者: bqsc    时间: 2004-08-03 14:47
标题: 请教透明代理中的问题
原帖由 "szkingrose" 发表:
echo 1 >;  /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -j MASQUERADE


我按照你这个规则做,怎么无法上网呢?
我的ETH0连接外网,ETH1是内网192。168。0。4
客户端2000把192-4设为网关和DNS,可以PING到外卡和内网卡,但是无法上网。
怎么回事?我的IPTABLES 是
[root@cc root]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
RH-Firewall-1-INPUT  all  --  anywhere             anywhere           

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
RH-Firewall-1-INPUT  all  --  anywhere             anywhere           

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     icmp --  anywhere             anywhere           icmp any
ACCEPT     ipv6-crypt--  anywhere             anywhere           
ACCEPT     ipv6-auth--  anywhere             anywhere           
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED
REJECT     all  --  anywhere             anywhere           reject-with icmp-host-prohibited
作者: szkingrose    时间: 2004-08-03 16:10
标题: 请教透明代理中的问题
先将firewall关了再试。
如查还不行,用QQ找我 szkingrose@hotmail.com
作者: bqsc    时间: 2004-08-03 17:01
标题: 请教透明代理中的问题
我关了防火墙,现在规则是这样,还是没法上网,我在AS3的X界面下上网很正常,也可以PING到www.163.com,就是客户机不行。
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
作者: bqsc    时间: 2004-08-04 19:11
标题: 请教透明代理中的问题
还不通,怎么回事啊这是。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2