当前位置: 技术问答>linux和unix
linux平台tcpsocket 连接失败
来源: 互联网 发布时间:2017-05-24
本文导语: 我们一个进程监听了7001,和7006端口, 客户端连接7001正常,连接7009失败,用tcpdump 看了详细结果如下图,系统没有设置防火墙。哪位大侠能帮忙解答下,万分感谢。 netstat 也被相应进程监听者。 linux平台tcpsocket 连接失败 [...
我们一个进程监听了7001,和7006端口, 客户端连接7001正常,连接7009失败,用tcpdump 看了详细结果如下图,系统没有设置防火墙。哪位大侠能帮忙解答下,万分感谢。 netstat 也被相应进程监听者。
linux平台tcpsocket 连接失败
[root@localhost server_maintrunk]# tcpdump tcp port 7006
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on em1, link-type EN10MB (Ethernet), capture size 65535 bytes
17:40:32.933063 IP 192.168.1.80.56380 > 192.168.1.107.afs3-errors: Flags [S], seq 171384339, win 8192, options [mss 1460,nop,wscale 8,sackOK,TS val 1734491 ecr 0], length 0
17:40:32.933086 IP 192.168.1.107.afs3-errors > 192.168.1.80.56380: Flags [R.], seq 0, ack 171384340, win 0, length 0
17:40:33.438851 IP 192.168.1.80.56380 > 192.168.1.107.afs3-errors: Flags [S], seq 171384339, win 8192, options [mss 1460,nop,wscale 8,sackOK,TS val 1734541 ecr 0], length 0
17:40:33.438865 IP 192.168.1.107.afs3-errors > 192.168.1.80.56380: Flags [R.], seq 0, ack 1, win 0, length 0
17:40:33.948817 IP 192.168.1.80.56380 > 192.168.1.107.afs3-errors: Flags [S], seq 171384339, win 8192, options [mss 1460,sackOK,TS val 1734592 ecr 0], length 0
17:40:33.948829 IP 192.168.1.107.afs3-errors > 192.168.1.80.56380: Flags [R.], seq 0, ack 1, win 0, length 0
^C
6 packets captured
6 packets received by filter
0 packets dropped by kernel
|
看起来端口7009没有在监听状态啊,所以收到SYN后,主机会回RST
11:59:11.284493 IP 192.168.1.128.va-pacbase > 192.168.1.107.afs3-rmtsys: Flags [S], seq 2953623323, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
11:59:11.284510 IP 192.168.1.107.afs3-rmtsys > 192.168.1.128.va-pacbase: Flags [R.], seq 0, ack 2953623324, win 0, length 0
用netstat -an | grep 7009 看看端口是否在监听状态
grep afs3 /etc/services
afs3-fileserver 7000/tcp # file server itself
afs3-fileserver 7000/udp # file server itself
afs3-callback 7001/tcp # callbacks to cache managers
afs3-callback 7001/udp # callbacks to cache managers
afs3-prserver 7002/tcp # users & groups database
afs3-prserver 7002/udp # users & groups database
afs3-vlserver 7003/tcp # volume location database
afs3-vlserver 7003/udp # volume location database
afs3-kaserver 7004/tcp # AFS/Kerberos authentication service
afs3-kaserver 7004/udp # AFS/Kerberos authentication service
afs3-volser 7005/tcp # volume managment server
afs3-volser 7005/udp # volume managment server
afs3-errors 7006/tcp # error interpretation service
afs3-errors 7006/udp # error interpretation service
afs3-bos 7007/tcp # basic overseer process
afs3-bos 7007/udp # basic overseer process
afs3-update 7008/tcp # server-to-server updater
afs3-update 7008/udp # server-to-server updater
afs3-rmtsys 7009/tcp # remote cache manager service
afs3-rmtsys 7009/udp # remote cache manager service
11:59:11.284493 IP 192.168.1.128.va-pacbase > 192.168.1.107.afs3-rmtsys: Flags [S], seq 2953623323, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
11:59:11.284510 IP 192.168.1.107.afs3-rmtsys > 192.168.1.128.va-pacbase: Flags [R.], seq 0, ack 2953623324, win 0, length 0
用netstat -an | grep 7009 看看端口是否在监听状态
grep afs3 /etc/services
afs3-fileserver 7000/tcp # file server itself
afs3-fileserver 7000/udp # file server itself
afs3-callback 7001/tcp # callbacks to cache managers
afs3-callback 7001/udp # callbacks to cache managers
afs3-prserver 7002/tcp # users & groups database
afs3-prserver 7002/udp # users & groups database
afs3-vlserver 7003/tcp # volume location database
afs3-vlserver 7003/udp # volume location database
afs3-kaserver 7004/tcp # AFS/Kerberos authentication service
afs3-kaserver 7004/udp # AFS/Kerberos authentication service
afs3-volser 7005/tcp # volume managment server
afs3-volser 7005/udp # volume managment server
afs3-errors 7006/tcp # error interpretation service
afs3-errors 7006/udp # error interpretation service
afs3-bos 7007/tcp # basic overseer process
afs3-bos 7007/udp # basic overseer process
afs3-update 7008/tcp # server-to-server updater
afs3-update 7008/udp # server-to-server updater
afs3-rmtsys 7009/tcp # remote cache manager service
afs3-rmtsys 7009/udp # remote cache manager service
|
楼主是不是监听端口搞错了,7006端口(也就是afs3-errors)没有监听啊!
|
不会是你的程序监听了localhost吧???