亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 10972 | 回復(fù): 8
打印 上一主題 下一主題

[proxy] squid+iptables 透明代理 QQ不能登錄 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2008-04-25 11:37 |只看該作者 |倒序?yàn)g覽
iptables配置(某個(gè)腳本文件):

#!/bin/bash
IPT="/sbin/iptables"
echo 1 > /proc/sys/net/ipv4/ip_forward

$IPT -t nat -F

$IPT -t nat -A PREROUTING -p tcp -s 172.16.0.0/16 --dport 80 -j REDIRECT --to-ports 3128
$IPT -t nat -A POSTROUTING -s 172.16.0.0/16 -d ! 172.16.0.0/16 -j MASQUERADE

#172.16.0.0/16為內(nèi)網(wǎng)段



squid 3.0 配置 squid.conf文件

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 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports

http_access allow localnet

http_access deny all


icp_access allow localnet
icp_access deny all

htcp_access allow localnet
htcp_access deny all

http_port 3128 transparent

hierarchy_stoplist cgi-bin ?

cache_dir ufs /cache 50000 16 256

access_log /usr/local/squid/var/logs/access.log squid

refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern (cgi-bin|\?)    0       0%      0
refresh_pattern .               0       20%     4320

visible_hostname sgg-squid-server

icp_port 3130

coredump_dir /usr/local/squid/var/cache



以上配置客戶段能夠正常瀏覽網(wǎng)頁,但是qq不能登錄.
不使用squid即iptables注釋掉以下行:
#  $IPT -t nat -A PREROUTING -p tcp -s 172.16.0.0/16 --dport 80 -j REDIRECT --to-ports 3128
客戶端qq能夠正常登錄。請大蝦們幫忙解決,不勝感激!


另:squid版本為 3.0.STABLE4  源代碼下載編譯,編譯配置選項(xiàng)為:
$ ./configure --enable-linux-netfilter --prefix=/usr/local/squid
啟動方式為:
#/usr/local/squid/sbin/squid

[ 本帖最后由 huang_xi_whu 于 2008-4-25 12:00 編輯 ]

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2008-04-25 16:38 |只看該作者
自己頂一下

qq登錄的錯(cuò)誤:

【QQ  版本】Build 17.91.715
【QQ  號碼】76431699
【操作系統(tǒng)】Microsoft Windows XP Service Pack 2 [Build 5.1.2600]

【網(wǎng)絡(luò)設(shè)置】局域網(wǎng)內(nèi)使用透明代理
【登錄過程】
---------------------------------------------------------------------------
        開始登錄......時(shí)間[2008-04-25 16:36:07]
        初始化登錄服務(wù)器列表,上次的登錄方式為【TCP登錄方式】
        嘗試指定服務(wù)器【58.251.62.77:80】...
        連接TCP服務(wù)器成功【58.251.62.77:80】
        TCP服務(wù)器【tcpconn2.tencent.com:80】需要域名解析...
        TCP服務(wù)器【tcpconn6.tencent.com:80】需要域名解析...
        TCP服務(wù)器【tcpconn3.tencent.com:80】需要域名解析...
        TCP服務(wù)器【tcpconn.tencent.com:80】需要域名解析...
        TCP服務(wù)器【tcpconn4.tencent.com:80】需要域名解析...
        TCP服務(wù)器【tcpconn5.tencent.com:80】需要域名解析...
        TCP服務(wù)器域名解析成功【tcpconn2.tencent.com:80】==>【219.133.60.246】
        連接TCP服務(wù)器成功【219.133.48.104:80】
        TCP服務(wù)器域名解析成功【tcpconn6.tencent.com:80】==>【121.14.74.247】
        TCP服務(wù)器域名解析成功【tcpconn3.tencent.com:80】==>【58.60.14.114】
        TCP服務(wù)器域名解析成功【tcpconn.tencent.com:80】==>【219.133.60.206】
        TCP服務(wù)器域名解析成功【tcpconn4.tencent.com:80】==>【58.60.15.41】
        TCP服務(wù)器域名解析成功【tcpconn5.tencent.com:80】==>【58.251.62.31】
        連接TCP服務(wù)器成功【219.133.60.246:80】
        連接TCP服務(wù)器成功【121.14.74.247:80】
        連接TCP服務(wù)器成功【58.60.14.114:80】
        連接TCP服務(wù)器成功【219.133.60.206:80】
        連接TCP服務(wù)器成功【58.60.15.41:80】
        連接TCP服務(wù)器成功【58.251.62.31:80】
        TCP登錄服務(wù)器全部嘗試失敗
        UDP服務(wù)器【sz8.tencent.com:8000】需要域名解析...
        UDP服務(wù)器【sz4.tencent.com:8000】需要域名解析...
        UDP服務(wù)器【sz7.tencent.com:8000】需要域名解析...
        UDP服務(wù)器【sz3.tencent.com:8000】需要域名解析...
        UDP服務(wù)器【sz.tencent.com:8000】需要域名解析...
        UDP服務(wù)器【sz9.tencent.com:8000】需要域名解析...
        UDP服務(wù)器【sz6.tencent.com:8000】需要域名解析...
        UDP服務(wù)器【sz5.tencent.com:8000】需要域名解析...
        UDP服務(wù)器【sz2.tencent.com:8000】需要域名解析...
        UDP服務(wù)器域名解析成功【sz8.tencent.com:8000】==>【219.133.60.75】
        UDP服務(wù)器域名解析成功【sz4.tencent.com:8000】==>【58.60.14.97】
        UDP服務(wù)器域名解析成功【sz7.tencent.com:8000】==>【121.14.75.57】
        UDP服務(wù)器域名解析成功【sz3.tencent.com:8000】==>【219.133.49.172】
        UDP服務(wù)器域名解析成功【sz.tencent.com:8000】==>【219.133.60.22】
        UDP服務(wù)器域名解析成功【sz9.tencent.com:8000】==>【219.133.48.102】
        UDP服務(wù)器域名解析成功【sz6.tencent.com:8000】==>【58.251.63.60】
        UDP服務(wù)器域名解析成功【sz5.tencent.com:8000】==>【58.60.15.38】
        UDP服務(wù)器域名解析成功【sz2.tencent.com:8000】==>【58.60.14.43】
        TCP登錄服務(wù)器全部嘗試失敗
        UDP登錄服務(wù)器全部嘗試失敗,嘗試下一種登錄方式
        TCP登錄服務(wù)器全部嘗試失敗
        UDP登錄服務(wù)器全部嘗試失敗,嘗試下一種登錄方式
        最終登錄失敗,時(shí)間:2008-04-25 16:36:38

[ 本帖最后由 huang_xi_whu 于 2008-4-25 16:40 編輯 ]

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2008-04-25 18:29 |只看該作者
squid的access log有如下錯(cuò)誤:

209117532.067      0 172.16.222.110 NONE/400 1838 POST http://60.28.230.18:80/ HTTP1.1 - NONE/- text/html
1209117553.041      0 172.16.222.110 NONE/400 1838 POST http://60.28.230.18:80/ HTTP1.1 - NONE/- text/html
1209117637.399      0 172.16.222.110 NONE/400 1811 NONE error:unsupported-request-method - NONE/- text/html
1209117667.336   3634 172.16.222.110 TCP_MISS/200 510 POST http://58.254.39.8/ - DIRECT/58.254.39.8 application/octet-stream
1209117668.025    648 172.16.222.110 TCP_MISS/200 237 POST http://58.254.39.8/ - DIRECT/58.254.39.8 application/octet-stream
1209117668.034    643 172.16.222.110 TCP_MISS/200 221 POST http://58.254.39.17/ - DIRECT/58.254.39.17 application/octet-stream
1209117668.643   1264 172.16.222.110 TCP_MISS/200 221 POST http://58.254.39.10/ - DIRECT/58.254.39.10 application/octet-stream
1209117668.653   1273 172.16.222.110 TCP_MISS/200 221 POST http://58.254.39.10/ - DIRECT/58.254.39.10 application/octet-stream
1209117669.321    668 172.16.222.110 TCP_MISS/200 221 POST http://58.254.39.10/ - DIRECT/58.254.39.10 application/octet-stream
1209117671.539   4146 172.16.222.110 TCP_MISS/200 478 POST http://221.12.89.107/ - DIRECT/221.12.89.107 application/octet-stream
1209117675.957  38535 172.16.222.110 TCP_MISS/502 1929 POST http://221.5.8.35/ - DIRECT/221.5.8.35 text/html
1209117769.057  41619 172.16.222.110 TCP_MISS/502 1929 POST http://221.5.8.35/ - DIRECT/221.5.8.35 text/html
1209117919.667 584969 172.16.222.110 TCP_MISS/200 21397866 GET http://softdl.tech.qq.com/soft/21/QQ2007II.zip - DIRECT/60.28.232.82 application/octet-stream
1209118054.007      0 172.16.222.110 NONE/400 1838 POST http://60.28.230.18:80/ HTTP1.1 - NONE/- text/html
1209118075.068      0 172.16.222.110 NONE/400 1838 POST http://60.28.230.18:80/ HTTP1.1 - NONE/- text/html
1209118289.187      0 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209118304.457   1041 172.16.222.110 TCP_MISS/502 1650 GET http://repair.qq.com/getxml - DIRECT/58.61.33.32 text/html
1209118305.470    994 172.16.222.110 TCP_MISS/502 1650 GET http://repair.qq.com/getxml - DIRECT/58.61.33.32 text/html
1209118306.560   1086 172.16.222.110 TCP_MISS/502 1650 GET http://repair.qq.com/getxml - DIRECT/58.61.33.32 text/html
1209118538.990      1 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209118538.990      1 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2008-04-25 22:42 |只看該作者
如果你能把下面這行換一下,我想你會把QQ登陸上的
$IPT -t nat -A POSTROUTING -s 172.16.0.0/16 -d ! 172.16.0.0/16 -j MASQUERADE
換成
$IPT -t nat -A POSTROUTING -s 172.16.0.0/16 -o eth0(外網(wǎng)網(wǎng)卡) -j SNAT --to A.B.C.D(外網(wǎng)的IP)

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2008-04-25 23:59 |只看該作者
原帖由 fuyankuncn 于 2008-4-25 22:42 發(fā)表
如果你能把下面這行換一下,我想你會把QQ登陸上的
$IPT -t nat -A POSTROUTING -s 172.16.0.0/16 -d ! 172.16.0.0/16 -j MASQUERADE
換成
$IPT -t nat -A POSTROUTING -s 172.16.0.0/16 -o eth0(外網(wǎng)網(wǎng)卡) -j ...

還是不行 ,我發(fā)現(xiàn)每次登錄qq不成功的時(shí)候access log里總有一個(gè)錯(cuò)誤,如下:
1208860581.101      0 172.16.222.110 NONE/400 1811 NONE error:unsupported-request-method - NONE/- text/html
1208860581.118      0 172.16.222.110 NONE/400 1811 NONE error:unsupported-request-method - NONE/- text/html
1209117637.399      0 172.16.222.110 NONE/400 1811 NONE error:unsupported-request-method - NONE/- text/html
1209118289.187      0 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209118538.990      1 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209118538.990      1 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209119555.290      0 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209136183.925      0 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209137971.327      0 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209138238.777      0 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209138620.576      0 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
1209139027.963      0 172.16.222.110 NONE/400 1810 NONE error:unsupported-request-method - NONE/- text/html
是不是qq使用了80端口但使用的非http協(xié)議。

論壇徽章:
0
6 [報(bào)告]
發(fā)表于 2008-08-01 16:50 |只看該作者
解決沒有啊,是不QQ使用了80端口,但http請求又符合標(biāo)準(zhǔn),我也遇到了同樣的問題。QQ亂開發(fā)協(xié)議,遲早會垮掉的。

論壇徽章:
0
7 [報(bào)告]
發(fā)表于 2008-08-07 10:46 |只看該作者
呵呵,,好東西呀,,QQ是想不斷地沖出新圍墻,可始終還是要走協(xié)議的吧...

論壇徽章:
0
8 [報(bào)告]
發(fā)表于 2013-01-16 15:21 |只看該作者
本帖最后由 netmwd 于 2013-01-16 15:21 編輯

需要加上 never_direct allow all
剛測試成功

論壇徽章:
0
9 [報(bào)告]
發(fā)表于 2013-01-17 09:23 |只看該作者
所有請求轉(zhuǎn)發(fā)至代理..   8樓,這個(gè)安全么?
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP