Ubuntu 9.10和Squid 2.7透明代理TCP_DENIED

我们花了两天的时间试图让Ubuntu 2.7与Ubuntu 9.10一起工作。 运行ubuntu的计算机有两个networking接口:eth0和eth1,在eth1上运行dhcp。 两个接口都有静态IP,eth0连接到Internet,eth1连接到我们的LAN。

我们一直遵循几十个不同的教程,但没有成功。 这里的教程是我们最后做的,实际上给了我们一些结果: http : //www.basicconfig.com/linuxnetwork/setup_ubuntu_squid_proxy_server_beginner_guide 。

当我们尝试从局域网上访问诸如seriouswheels.com这样的网站时,我们在客户机上得到以下消息:


错误

所请求的url无法检索

尝试处理请求时遇到无效的请求错误:

GET / HTTP / 1.1
主持人:www.seriouswheels.com
连接:保持活力
User-Agent:Mozilla / 5.0(X11; U; Linux x86_64; en-US)AppleWebKit / 532.9(KHTML,如Gecko)Chrome / 5.0.307.11 Safari / 532.9
Cache-Control:max-age = 0
接受:application / xml,application / xhtml + xml,text / html; q = 0.9,text / plain; q = 0.8,image / png, / ; q = 0.5 Accept-Encoding:gzip,deflate,sdch Cookie:__utmz = 88947353.1269218405.1.1.utmccn =(直接)| utmcsr =(直接)| utmcmd =(无); __qca = P0-1052556952-1269218405250; __utma = 88947353.1027590811.1269218405.1269218405.1269218405.1; 接收字符集:ISO-8859-1,utf-8; q = 0.7,*; q = 0.3

一些可能的问题是:

缺less或未知的请求方法。

缺lessurl。

缺lessHTTP标识符(HTTP / 1.0)。

请求太大。

内容长度缺lessPOST或PUT请求。

主机名中的非法字符; 下划线是不允许的。

您的cachingpipe理员是网站pipe理员。


以下是所有configuration文件:/etc/squid/squid.conf,/etc/network/if-up.d/00-firewall,/ etc / network / interfaces,/var/log/squid/access.log。 什么地方是错的,但我们不知道在哪里。

我们最终的目标是在客户端在局域网上请求的每一页上叠加内容。 我们被告知,鱿鱼是做到这一点的方式,但在这一点上,我们只是试图正确地将鱿鱼设置为我们的代理

提前致谢。

squid.conf中

acl所有src所有
aclpipe理器proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 192.168.0.0/24
acl SSL_ports端口443#https
acl SSL_ports端口563#snews
acl SSL_ports端口873#rsync
acl Safe_ports端口80#http
acl Safe_ports端口21#ftp
acl Safe_ports端口443#https
acl Safe_ports port 70#gopher
acl Safe_ports端口210#wais
acl Safe_ports端口1025-65535#未注册的端口
acl Safe_ports port 280#http-mgmt
acl Safe_ports port 488#gss-http
acl Safe_ports端口591#filemaker
acl Safe_ports端口777#multiling http
acl Safe_ports端口631#杯
acl Safe_ports端口873#rsync
acl Safe_ports端口901#SWAT
acl吹扫方法PURGE
acl CONNECT方法CONNECT
http_access允许pipe理本地主机
http_access拒绝经理
http_access允许清除本地主机
http_access拒绝清除
http_access拒绝!Safe_ports
http_access拒绝CONNECT!SSL_ports
http_access允许localhost
http_access允许localnet
http_access拒绝所有
icp_access允许localnet
icp_access全部拒绝
http_port 3128
hierarchy_stoplist cgi-bin?
cache_dir ufs / var / spool / squid / cache1 1000 16 256
access_log /var/log/squid/access.log squid
refresh_pattern ^ ftp:1440 20%10080
refresh_pattern ^ gopher:1440 0%1440
refresh_pattern -i(/ cgi-bin / | \?)0 0%0
refresh_pattern(Release | Package(.gz)*)$ 0 20%2880
refresh_pattern。 0 20%4320
acl shoutcast rep_header X-HTTP09-First-Line ^ ICY。[0-9]
upgrade_http0.9否认shoutcast
acl apache rep_header服务器^ Apache
broken_vary_encoding允许apache
extension_methods报告合并MKACTIVITY CHECKOUT
cache_mgr网站pipe理员
cache_effective_user代理
cache_effective_group代理
hosts_file / etc / hosts
coredump_dir / var / spool / squid


access.log的


1269243042.740 0 192.168.1.11 TCP_DENIED / 400 2576 GET NONE:// – NONE / – text / html


00防火墙

iptables -F iptables -t nat -F iptables -t mangle -F iptables -X

回声1 | tee / proc / sys / net / ipv4 / ip_forward

iptables -t nat -A POSTROUTING -j MASQUERADE

iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDIRECT – 到端口3128


联网

汽车
iface lo inet loopback

auto eth0
iface eth0 inet static
地址142.104.109.179
networking掩码255.255.224.0
网关142.104.127.254

auto eth1
iface eth1 inet static
地址192.168.1.100
networking掩码255.255.255.0


你必须告诉鱿鱼它被设置为一个透明的系统

代替

http_port 3128 

你需要

 # enable the transparent option for interception caching http_port 3128 transparent