Squid 2.7.STABLE3-4.1作为Ubuntu Server 9.04上的透明代理

无法得到这个工作! 我试图让这个linux的机器作为一个透明的代理,并在DHCP的帮助下,强迫networking上的每个人进入代理。

我有两个以太网连接,都是同一个交换机。 我试图让192.168.1.234成为默认网关。
实际的广域网连接是到网关192.168.1.1。
eth0是192.168.1.234
eth1是192.168.1.2

有效地,我正在尝试使eth0成为LAN接口,eth1成为WAN接口。 我有oi应该设置eth1的网关指向192.168.1.234

我的squid.conf文件在底部添加了以下指令:nly将eth0设置为/ etc / network / interfaces中的网关地址我不确定http_port 3128是否透明acl lan src 192.168.1.0/24 acl lh src 127.0 .0.1 / 255.255.255.0 http_access允许lan http_access允许lh

我已经添加了以下路由命令:

iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.2:3128 iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128 

我设置了一台TCP设置为192.168.1.234的计算机作为网关,打开了google.com,但是出现了请求错误。 任何想法,为什么这是行不通的? :(一直在寻找一个解决scheme无济于事。

—————————–编辑——————– ———–pipe理得到它正确的路由到鱿鱼,这里是我在浏览器中得到的错误:

 ERROR The requested URL could not be retrieved While trying to process the request: GET / HTTP/1.1 Host: www.google.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-gb,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Cache-Control: max-age=0 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 webmaster. Generated Mon, 26 Oct 2009 03:41:15 GMT by mjolnir.lloydharrington.local (squid/2.7.STABLE3) 

确保你没有冲突的端口定义,鱿鱼可能会在3128听,所以你可能需要修改现有的声明,而不是添加一个新的。

也可以尝试手动将该框设置为代理,并确保它在其他方式下工作,然后才能使其透明。