LinuxSir.cn,穿越时空的Linuxsir!

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

iptables + squid 不能正常上网

[复制链接]
发表于 2007-4-10 19:31:08 | 显示全部楼层 |阅读模式
FC6     Squid    Version     : 2.6.STABLE4

配置很简单:

#更改所有来自192.168.1.0/24的数据包的源ip地址为192.168.1.243
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth0 -j SNAT --to 192.168.1.243

#更改80端口的访问到SQUID的3128
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-ports 3128   

SQUID启动后,访问80端的网站出现下面的错误提示:

The following error was encountered:

Invalid Request
Some aspect of the HTTP Request is invalid. Possible problems:

Missing or unknown request method
Missing URL
Missing HTTP Identifier (HTTP/1.0)
Request is too large
Content-Length missing for POST or PUT requests
Illegal character in hostname; underscores are not allowed
Your cache administrator is root.

--------------------------------------------------------------------------------

Generated Tue, 10 Apr 2007 17:51:53 GMT by redhat (squid/2.6.STABLE4)

我访问其他的都正常,访问非80端口的网页也正常,请问我的问题出在那里了,该怎么调一下?谢谢了!
发表于 2007-4-16 10:36:53 | 显示全部楼层
估计
DNS转发问题
/sbin/iptables -A INPUT -i eth0 -p udp --sport 53 -j ACCEPT
/sbin/iptables -A INPUT -i eth1 -p udp --sport 53 -j ACCEPT
内网机子用外网的dns
再不行试试
/sbin/iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -j MASQUERADE
/sbin/iptables -A INPUT -s 192.168.10.0/24 -p tcp --dport 3128 -j ACCEPT
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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