问题现象:

通过IE从服务器下载文件时,提示Can't read from connection: Connection reset by peer。

别的现场都是好的,只有该现场有这个问题。所以,一直以为现场的网络或者防火墙设置有问题,导致该问题一直未解决。

今天,想到可能和下载的文件大小有关系,于是在linux服务器上通过wget单个文件下载测试,发现小于0.5M的文件下载正常。

超过0.5M,就提示Connection reset by peer。

下面是测试过程:

Last login: Wed Oct 9 15:40:57 2013 from 202.195.128.18
[root@w5-1 ~]# ping 221.***.212.94
PING 221.***.212.94 (221.***.212.94) 56(84) bytes of data.
64 bytes from 221.***.212.94: icmp_seq=1 ttl=57 time=9.56 ms
64 bytes from 221.***.212.94: icmp_seq=2 ttl=57 time=9.30 ms
64 bytes from 221.***.212.94: icmp_seq=3 ttl=57 time=9.37 ms
64 bytes from 221.***.212.94: icmp_seq=4 ttl=57 time=9.44 ms
64 bytes from 221.***.212.94: icmp_seq=5 ttl=57 time=9.61 ms
64 bytes from 221.***.212.94: icmp_seq=6 ttl=57 time=9.37 ms

[1]+ Stopped ping 221.***.212.94
[root@w5-1 ~]# ping svn.***.com
PING svn.***.com (221.***.212.94) 56(84) bytes of data.
64 bytes from mail.***.com (221.***.212.94): icmp_seq=1 ttl=57 time=9.82 ms
64 bytes from mail.***.com (221.***.212.94): icmp_seq=2 ttl=57 time=9.58 ms
64 bytes from mail.***.com (221.***.212.94): icmp_seq=3 ttl=57 time=9.58 ms
64 bytes from mail.***.com (221.***.212.94): icmp_seq=4 ttl=57 time=10.1 ms

[2]+ Stopped ping svn.***.com
[root@w5-1 ~]# wget
wget:未指定 URL
用法: wget [选项]... [URL]...

请尝试使用“wget --help”查看更多的选项。
[root@w5-1 ~]# wget http://demo.***.cn:10085/5/1.txt
--2013-10-09 16:15:40-- http://demo.***.cn:10085/5/1.txt
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1073 (1.0K) [text/plain]
Saving to: `1.txt'

100%[======================================>] 1,073 --.-K/s in 0s

2013-10-09 16:15:40 (146 MB/s) - `1.txt' saved [1073/1073]

[root@w5-1 ~]# wget http://demo.***.cn:10085/5/1.jar
--2013-10-09 16:16:42-- http://demo.***.cn:10085/5/1.jar
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:18124391 (17M) [text/plain]
Saving to: `1.jar'

0% [ ] 5,547 --.-K/s in 60s

2013-10-09 16:17:42 (92.6 B/s) - Read error at byte 5547/18124391 (Connection reset by peer). 重试中。

--2013-10-09 16:17:43-- (尝试次数: 2) http://demo.***.cn:10085/5/1.jar
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:18124391 (17M) [text/plain]
Saving to: `1.jar'

2% [ ] 399,403 87.0K/s eta 2m 37s
[3]+ Stopped wget http://demo.***.cn:10085/5/1.jar

[root@w5-1 ~]# wget http://demo.***.cn:10085/5/1.log
--2013-10-09 16:24:04-- http://demo.***.cn:10085/5/1.log
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:4916089 (4.7M) [text/plain]
Saving to: `1.log'

7% [=============> ] 366,100 --.-K/s in 61s

2013-10-09 16:25:05 (5.89 KB/s) - Read error at byte 366100/4916089 (Connection reset by peer). 重试中。

--2013-10-09 16:25:06-- (尝试次数: 2) http://demo.***.cn:10085/5/1.log
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:4916089 (4.7M) [text/plain]
Saving to: `1.log'

13% [=============> ] 717,964 --.-K/s in 62s

2013-10-09 16:26:08 (11.4 KB/s) - Read error at byte 717964/4916089 (Connection reset by peer). 重试中。

--2013-10-09 16:26:10-- (尝试次数: 3) http://demo.***.cn:10085/5/1.log
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:4916089 (4.7M) [text/plain]
Saving to: `1.log'

16% [================> ] 920,684 192K/s eta 19s
[4]+ Stopped wget http://demo.***.cn:10085/5/1.log
[root@w5-1 ~]# wget -r -np -nd http://demo.***.cn:10085/5/1/
--2013-10-09 16:28:56-- http://demo.***.cn:10085/5/1/
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 404 Not Found
2013-10-09 16:28:56 错误 404:Not Found。

[root@w5-1 ~]# wget -r -np -nd http://demo.***.cn:10085/5/1/
--2013-10-09 16:29:06-- http://demo.***.cn:10085/5/1/
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 404 Not Found
2013-10-09 16:29:06 错误 404:Not Found。

[root@w5-1 ~]# wget -r -np -nd http://demo.***.cn:10085/5/images/
--2013-10-09 16:29:37-- http://demo.***.cn:10085/5/images/
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 404 Not Found
2013-10-09 16:29:37 错误 404:Not Found。

[root@w5-1 ~]# wget -r -np -nd http://demo.***.cn:10085/5/2.jar
--2013-10-09 16:32:04-- http://demo.***.cn:10085/5/2.jar
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1070477 (1.0M) [text/plain]
Saving to: `2.jar'

7% [===========================> ] 77,120 --.-K/s in 60s

2013-10-09 16:33:04 (1.26 KB/s) - Read error at byte 77120/1070477 (Connection reset by peer). 重试中。

--2013-10-09 16:33:05-- (尝试次数: 2) http://demo.***.cn:10085/5/2.jar
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1070477 (1.0M) [text/plain]
Saving to: `2.jar'

0% [> ] 11,340 --.-K/s eta 85m 50s
[5]+ Stopped wget -r -np -nd http://demo.***.cn:10085/5/2.jar

[root@w5-1 ~]# wget -r -np -nd http://demo.***.cn:10085/5/1.txt
--2013-10-09 16:34:02-- http://demo.***.cn:10085/5/1.txt
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1073 (1.0K) [text/plain]
Saving to: `1.txt.1'

100%[===================================>] 1,073 --.-K/s in 0s

2013-10-09 16:34:02 (102 MB/s) - `1.txt.1' saved [1073/1073]

FINISHED --2013-10-09 16:34:02--
Downloaded: 1 files, 1.0K in 0s (102 MB/s)

[root@w5-1 ~]# wget -r -np -nd http://demo.***.cn:10085/5/3.jar
--2013-10-09 16:34:39-- http://demo.***.cn:10085/5/3.jar
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:579511 (566K) [text/plain]
Saving to: `3.jar'

100%[=====================================>] 579,511 545K/s in 1.0s

2013-10-09 16:34:40 (545 KB/s) - `3.jar' saved [579511/579511]

FINISHED --2013-10-09 16:34:40--
Downloaded: 1 files, 566K in 1.0s (545 KB/s)

[root@w5-1 ~]# wget -r -np -nd http://demo.***.cn:10085/5/4.jar
--2013-10-09 16:35:34-- http://demo.***.cn:10085/5/4.jar
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:840550 (821K) [text/plain]
Saving to: `4.jar'

17% [================> ] 143,109 --.-K/s in 60s

2013-10-09 16:36:35 (2.32 KB/s) - Read error at byte 143109/840550 (Connection reset by peer). 重试中。

--2013-10-09 16:36:36-- (尝试次数: 2) http://demo.***.cn:10085/5/4.jar
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:840550 (821K) [text/plain]
Saving to: `4.jar'

6% [=====> ] 62,021 --.-K/s eta 8m 45s

[6]+ Stopped wget -r -np -nd http://demo.***.cn:10085/5/4.jar
[root@w5-1 ~]# wget -r -np -nd http://demo.***.cn:10085/5/5.jar
--2013-10-09 16:37:17-- http://demo.***.cn:10085/5/5.jar
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:571259 (558K) [text/plain]
Saving to: `5.jar'

49% [========================================> ] 282,117 --.-K/s in 61s

2013-10-09 16:38:18 (4.54 KB/s) - Read error at byte 282117/571259 (Connection reset by peer). 重试中。

--2013-10-09 16:38:19-- (尝试次数: 2) http://demo.***.cn:10085/5/5.jar
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:571259 (558K) [text/plain]
Saving to: `5.jar'

8% [========> ] 76,501 --.-K/s
[7]+ Stopped wget -r -np -nd http://demo.***.cn:10085/5/5.jar

[root@w5-1 ~]# wget -r -np -nd http://demo.***.cn:10085/5/3.jar
--2013-10-09 16:38:55-- http://demo.***.cn:10085/5/3.jar
正在解析主机 demo.***.cn... 221.***.212.94
Connecting to demo.***.cn|221.***.212.94|:10085... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:579511 (566K) [text/plain]
Saving to: `3.jar.1'

100%[======================================>] 579,511 391K/s in 1.4s

2013-10-09 16:38:56 (391 KB/s) - `3.jar.1' saved [579511/579511]

FINISHED --2013-10-09 16:38:56--
Downloaded: 1 files, 566K in 1.4s (391 KB/s)
[root@w5-1 ~]#

问题分析:

    根据上面现象,象是现场网络或者防火墙设置有问题。于是通过tcpdump抓包看看。

>tcpdump -w 1.cap -----在这一刻,继续wget

根据对cap文件的分析,发现是下载链接http://demo.***.cn:10085所在的服务器主动Connection reset ,进而导致下载失败。

这就说明,是demo.***.cn:10085域名所在的防火墙设置有问题。经过了解,该防火墙本身就存在问题。

问题解决:

对demo.***.cn:10085域名在一个新防火墙上重新设置,经过测试,问题解决。

Linux:外网域名防火墙设置导致下载失败的更多相关文章

  1. 微信公众号开发之怎样将本机IP映射成外网域名

    近期一个项目须要用到微信公众号的网页授权登录,在研究这个公众号的时候遇到各种困难,现将自己的一些心得总结一下. 我想进行微信公众号开发遇到的第一个困难就是微信公众号必须输入一个外网能够訪问的域名,在网 ...

  2. 外网域名映射内网Ip 内网使用外网域名的https证书

    用nslookup www.baidu.com nslookup www.qq.com 15.64.64.53 测试了内网的dns可以解析外网域名 那么我买个外网域名,再对这个外网域名买个证书,然后外 ...

  3. cordova之File Transfer (Permission denied) 权限导致下载失败 - 简书

    原文:cordova之File Transfer (Permission denied) 权限导致下载失败 - 简书 在文件上传时,由于权限问题,会报错(Permission denied),安卓6. ...

  4. 将内网ip映射到外网域名

     一.应用场景 1.在本地测试微信支付回调 二.如何使用natapp实现内网穿透 1.第一步注册账号并进行实名制认证 natapp网站地址 https://natapp.cn/ 2.第二步申请免费隧道 ...

  5. oracle连接由于防火墙设置导致超时的问题

        当应用程序使用数据库连接池进行数据连接时,防火墙的设置有可能会导致连接出现超时或者被重置的问题.当从数据库读数据的时候 有可能会 Connection timed out, 这是由于应用会缓存 ...

  6. 服务器能远程连接,网络连接正常,但是外网域名Ping不通,浏览器中打不开网站

    服务器能远程连接成功,但在浏览器中打不开任何网站,出现这个问题一般是安装什么软件引起IE的相关设置做了变动或者是服务器中了病毒引起的,或是服务器的DNS设置是错误的. 一.先检查服务器DNS是否正确 ...

  7. 【微信Java开发 --1】内网穿透外网,使用外网域名可以访问到本地项目

    1.首先上https://natapp.cn/ 2.接下来在网站申请账号 3.购买免费隧道 4.为你的免费隧道设置名称以及端口号,由于本人本地的使用Tomcat做服务器,所以用惯了8080端口,因此设 ...

  8. LINUX一网卡多IP设置

    方法1:少量IP手动绑定(这里以绑定IP到eth0为例,其它网卡的话修改相应的文件名即可) 1.复制ifcfg-eth0的网卡配置文件并改名为ifcfg-eth0:0 [root@akinlau /] ...

  9. MySql外网不能访问设置

    mysql的root账户,我在连接时通常用的是localhost或127.0.0.1,公司的测试服务器上的mysql也是localhost所以我想访问无法访问,测试暂停. 解决方法如下: 1,修改表, ...

随机推荐

  1. *Codeforces989D. A Shade of Moonlight

    数轴上$n \leq 100000$个不重叠的云,给坐标,长度都是$l$,有些云速度1,有些云速度-1,风速记为$w$,问在风速不大于$w_{max}$时,有几对云可能在0相遇.每一对云单独考虑. 多 ...

  2. 降雨量 BZOJ 1067

    降雨量 [问题描述] 我们常常会说这样的话:“X年是自Y年以来降雨量最多的”.它的含义是X年的降雨量不超过Y年,且对于任意Y<Z<X,Z年的降雨量严格小于X年.例如2002,2003,20 ...

  3. WEB学习-CSS基础选择器

    基础选择器 标签选择器 就是标签的名字. • <h1>前端与移动开发<span>1期班</span>基础班</h1> css: • <style ...

  4. php 笔记 汇总 学习

    php命令行:通过命令行进入到当前要被执行的php文件路径,然后输入php环境可执行路径(后面包含php.exe),然后输入要被执行的php文件,比如runData.php即可. php框架:yaf. ...

  5. 配置maven从私服上下载构件

    maven 本地setting.xml配置 <!--配置maven从私服上下载构件 --> <profiles> <profile> <repositorie ...

  6. android EditText禁止复制粘贴完整代码

    <!-- 定义基础布局LinearLayout --> <LinearLayout xmlns:android="http://schemas.android.com/ap ...

  7. SODBASE CEP学习(四)续:类SQL语言EPL与Storm或jStorm集成-使用分布式缓存

    流式计算在一些情况下会用到分布式缓存,从而实现(1)想把统计或计算结果保存在分布缓存中.供其他模块或其他系统调用. (2)某一滑动时间窗体上计数.比如实时统计1小时每一个Cookie的訪问量.实时统计 ...

  8. jobject和jclass

    jclass和jobject的迷惑第一次使用JNI,实例引用(jobject)和类引用(jclass)让人觉得很困惑.实例引用与一个数组和java.lang.Object类或它的子类的实例对应.类引用 ...

  9. 手动编译一个c文件(Win7下如何使用GCC编译器)

    主要参考这篇http://jingyan.baidu.com/article/c275f6bacc0126e33c756771.html 我没找到minGW的下载地址,而是直接用codeblocks自 ...

  10. android Graphics类:概述及基本几何图形绘制

    当须要在Android上绘制图形时.就会用到Graphics类.Paint类.Paint就是相当于笔,而Canvas就是 纸.这里叫画布. 所以,凡有跟要要画的东西的设置相关的.比方大小,粗细,画笔颜 ...