4,仅网络专家协助,junper路由器上的路由有问题,导致回包不能正确送达。
案例2:sqlplus客户端不能连接Oracle数据库的问题,连接时报错ORA-12537
现象:连接报错
[oracle@localhost ~]$ sqlplussomczx/somc@SMPDB
SQL*Plus: Release 11.2.0.2.0 Production on 星期一 11月 25 14:32:452013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12537: TNS: 连接关闭
客户端抓包:收到了回来的数据包,但连接却关闭了
[root@localhost ~]# tcpdump -i eth0 host192.168.3.220
tcpdump: verbose output suppressed, use -vor -vv for full protocol decode
listening on eth0, link-type EN10MB(Ethernet), capture size 96 bytes
16:48:07.048525 IP 192.168.1.45.38405 >192.168.3.220.ncube-lm: S 2870102332:2870102332(0) win 5840 <mss1460,sackOK,timestamp 443389148 0,nop,wscale 7>
16:48:07.048872 IP 192.168.3.220.ncube-lm> 192.168.1.45.38405: S 2343325666:2343325666(0) ack 2870102333 win 65535<mss 1460,nop,wscale 3,sackOK,timestamp 32985 443389148>
16:48:07.048882 IP 192.168.1.45.38405 >192.168.3.220.ncube-lm: . ack 1 win 46 <nop,nop,timestamp 44338914932985>
16:48:07.049044 IP 192.168.1.45.38405 >192.168.3.220.ncube-lm: P 1:225(224) ack 1 win 46 <nop,nop,timestamp443389149 32985>
16:48:07.049145 IP 192.168.3.220.ncube-lm> 192.168.1.45.38405: . ack 225 win 8298 <nop,nop,timestamp 32986443389149>
16:49:07.370802 IP 192.168.3.220.ncube-lm> 192.168.1.45.38405: F 1:1(0) ack 225 win 8298 <nop,nop,timestamp 92987443389149>
16:49:07.370888 IP 192.168.1.45.38405 >192.168.3.220.ncube-lm: . ack 2 win 46 <nop,nop,timestamp 44344947192987>
16:49:07.371014 IP 192.168.1.45.38405 >192.168.3.220.ncube-lm: F 225:225(0) ack 2 win 46 <nop,nop,timestamp443449471 92987>
16:49:07.371121 IP 192.168.3.220.ncube-lm> 192.168.1.45.38405: . ack 226 win 8297 <nop,nop,timestamp 92987443449471>
数据库服务器端抓包,只收到了数据包请求,但没有回应的数据包(注意这个client端收到了回包是矛盾的,至今也没明白具体原因)
16:53:57.176963 IP 192.168.1.45.38405 >DSAPP2.ncube-lm: Flags [S], seq 1170139240, win 65535, options [mss1380,nop,wscale 3,sackOK,TS val 32986 ecr 0], length 0
16:54:00.185469 IP 192.168.1.45.38405 >DSAPP2.ncube-lm: Flags [S], seq 1170139240, win 65535, options [mss1380,nop,wscale 3,sackOK,TS val 35986 ecr 0], length 0
16:54:03.396744 IP 192.168.1.45.38405 >DSAPP2.ncube-lm: Flags [S], seq 1170139240, win 65535, options [mss1380,nop,wscale 3,sackOK,TS val 39186 ecr 0], length 0
16:54:06.618718 IP 192.168.1.45.38405 >DSAPP2.ncube-lm: Flags [S], seq 1170139240, win 65535, options [mss1380,sackOK,eol], length 0
16:54:09.846067 IP 192.168.1.45.38405 >DSAPP2.ncube-lm: Flags [S], seq 1170139240, win 65535, options [mss1380,sackOK,eol], length 0
16:54:13.073922 IP 192.168.1.45.38405 >DSAPP2.ncube-lm: Flags [S], seq 1170139240, win 65535, options [mss1380,sackOK,eol], length 0
16:54:19.326237 IP 192.168.1.45.38405 >DSAPP2.ncube-lm: Flags [S], seq 936514366, win 65535, options [mss1380,sackOK,eol], length 0
16:54:31.603109 IP 192.168.1.45.38405 >DSAPP2.ncube-lm: Flags [S], seq 936514366, win 65535, options [mss1380,sackOK,eol], length 0
16:54:55.892606 IP 192.168.1.45.38405 >DSAPP2.ncube-lm: Flags [S], seq 802356553, win 65535, options [mss1380,sackOK,eol], length 0
初步定位
既然服务器端收到了数据库包,说明1521端口,在防火墙已经开通了。问题在数据库服务器端。服务器的listener.log日志中也没有发现任何来自客户端的连接请求。
最终定位:
数据库服务器上开启了iptables防火墙策略,导致客户端连不上数据库,在iptables上开通相关防火墙策略后,访问即正常了
案例3:使用linux iptables后ftp端口不通的情况
现象:ftp能正常连接,但不能传输数据
ftp不通时的抓包现象,数据传输使用了ftp-data端口
root@stylog1 ~]# tcpdump -i bond0 host 192.168.9.37
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on bond0, link-type EN10MB (Ethernet), capture size 65535 bytes
10:48:10.171437 IP 192.168.9.37.55460 > 192.168.5.5.ftp: Flags [P.], seq 2473112340:2473112365, ack 2946208393, win 8064, length 25
10:48:10.171486 IP 192.168.5.5.ftp > 192.168.9.37.55460: Flags [.], ack 25, win 115, length 0
10:51:38.397111 IP 192.168.5.5.ftp-data > 192.168.9.37.55516: Flags [S], seq 2207620674, win 14600, options [mss 1460,sackOK,TS val 1965825832 ecr 0,nop,wscale 7], length 0
10:51:54.397107 IP 192.168.5.5.<SPAN>ftp-data</SPAN> > 192.168.9.37.55516: Flags [S], seq 2207620674, win 14600, options [mss 1460,sackOK,TS val 1965841832 ecr 0,nop,wscale 7], length 0
ftp-data使用了20端口,这个端口没开防火墙策略
[root@stylog1 ~]# cat /etc/services |grep ftp-data
ftp-data 20/tcp
ftp-data 20/udp
ftp-data 20/sctp # FTP
kftp-data 6620/tcp # Kerberos V5 FTP Data
kftp-data 6620/udp # Kerberos V5 FTP Data