免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1716 | 回复: 8
打印 上一主题 下一主题

[proxy] 请教透明代理中的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 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

求各位高手指教!!!

论坛徽章:
0
2 [报告]
发表于 2004-08-02 07:52 |只看该作者

请教透明代理中的问题

echo 1 >;  /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -j MASQUERADE

论坛徽章:
0
3 [报告]
发表于 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端口不行呀。不知问题在那里呀。

论坛徽章:
0
4 [报告]
发表于 2004-08-02 17:12 |只看该作者

请教透明代理中的问题

iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
试试!

论坛徽章:
0
5 [报告]
发表于 2004-08-03 10:18 |只看该作者

请教透明代理中的问题

to szkingrose
谢谢你的帮助,我的问题解决了!
好像加了/sbin/modprobe ip_conntrack_irc
端口转发就正常了

论坛徽章:
0
6 [报告]
发表于 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

论坛徽章:
0
7 [报告]
发表于 2004-08-03 16:10 |只看该作者

请教透明代理中的问题

先将firewall关了再试。
如查还不行,用QQ找我 szkingrose@hotmail.com

论坛徽章:
0
8 [报告]
发表于 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

论坛徽章:
0
9 [报告]
发表于 2004-08-04 19:11 |只看该作者

请教透明代理中的问题

还不通,怎么回事啊这是。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP