首页 文章

Ubuntu 9.10和Squid 2.7透明代理TCP_DENIED

提问于
浏览
0

过去两天我们一直试图让squid 2.7与ubuntu 9.10一起工作 . 运行ubuntu的计算机有两个网络接口:eth0和eth1,在eth1上运行dhcp . 两个接口都有静态IP,eth0连接到Internet,eth1连接到LAN .

我们已经完成了数十种不同的教程,但没有成功 . 这里的教程是我们做的最后一个实际上得到了一些结果:http://www.basicconfig.com/linuxnetwork/setup_ubuntu_squid_proxy_server_beginner_guide .

当我们尝试从局域网访问像seriouswheels.com这样的网站时,我们在客户端计算机上收到以下消息:


错误

所请求的网址无法检索

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

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
缓存控制: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; __qseg = Q_D Accept-Language:en-US,en; q = 0.8 Accept-Charset:ISO-8859-1,utf-8; q = 0.7,*; q = 0.3

一些可能的问题是:

缺少或未知的请求方法 .

缺少网址 .

缺少HTTP标识符(HTTP / 1.0) .

请求太大 .

POST或PUT请求缺少Content-Length .

主机名中的非法字符;不允许使用下划线 .

您的缓存管理员是网站管理员 .


以下是所有配置文件:/etc/squid/squid.conf,/etc/network/if-up.d/00-firewall,/ etc / network / interfaces,/ var / log / spam / access .log . 某个地方的东西是错的,但我们无法弄清楚在哪里 .

我们所有这一切的最终目标是将内容叠加到客户端在LAN上请求的每个页面上 . 我们被告知鱿鱼是这样做的方法,但在游戏的这一点上,我们只是试图将鱿鱼设置正确作为我们的代理 .

提前致谢 .

squid.conf

acl all src all
acl manager 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 port 443#https
acl SSL_ports端口563#snews
acl SSL_ports端口873#rsync
acl Safe_ports端口80#http
acl Safe_ports port 21#ftp
acl Safe_ports port 443#https
acl Safe_ports端口70#gopher
acl Safe_ports端口210#wais
acl Safe_ports端口1025-65535#未注册端口
acl Safe_ports端口280#http-mgmt
acl Safe_ports端口488#gss-http
acl Safe_ports端口591#filemaker
acl Safe_ports端口777#multiling http
acl Safe_ports port 631#cups
acl Safe_ports端口873#rsync
acl Safe_ports port 901#SWAT
acl purge方法PURGE
acl CONNECT方法CONNECT
http_access允许管理器localhost
http_access拒绝经理
http_access允许清除localhost
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(发布|包(.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 Server ^ Apache
broken_vary_encoding允许apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
cache_mgr网站管理员
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 -firewall

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

echo 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 --to-port 3128


网络

汽车
iface lo inet loopback

自动eth0
iface eth0 inet static
地址142.104.109.179
网络掩码255.255.224.0
网关142.104.127.254

汽车eth1
iface eth1 inet static
地址192.168.1.100
网络掩码255.255.255.0


1 回答

相关问题