佳木斯湛栽影视文化发展公司

主頁(yè) > 知識(shí)庫(kù) > linux解決ping通但端口不通的問(wèn)題

linux解決ping通但端口不通的問(wèn)題

熱門標(biāo)簽:百度競(jìng)價(jià)點(diǎn)擊價(jià)格的計(jì)算公式 美圖手機(jī) 網(wǎng)站建設(shè) 阿里云 智能手機(jī) 檢查注冊(cè)表項(xiàng) 使用U盤裝系統(tǒng) 硅谷的囚徒呼叫中心

能ping 通但端口不通時(shí)端口可用性探測(cè)說(shuō)明

端口可用性探測(cè)工具介紹

不同的操作系統(tǒng),端口可用性探測(cè)所使用的工具也有所不同。

Linux 環(huán)境下端口可用性探測(cè)工具介紹

traceroute 是幾乎所有 Linux 發(fā)行版本預(yù)裝的網(wǎng)絡(luò)測(cè)試工具,用于跟蹤 Internet 協(xié)議(IP)數(shù)據(jù)包傳送到目標(biāo)地址時(shí)經(jīng)過(guò)的路徑。您可以通過(guò) traceroute 工具進(jìn)行端口可用性探測(cè)。

traceroute 通過(guò)發(fā)送 TCP 數(shù)據(jù)包向目標(biāo)端口進(jìn)行探測(cè),以檢測(cè)從數(shù)據(jù)包源到目標(biāo)服務(wù)器的整個(gè)鏈路上相應(yīng)端口的連通性情況。

traceroute 端口可用性探測(cè)常見(jiàn)用法如下:

traceroute [-n] -T -p <目標(biāo)端口號(hào)> Host

示例

[root@centos~]# traceroute -n -T -p 22 223.5.5.5
traceroute to 223.5.5.5 (223.5.5.5), 30 hops max, 60 byte packets
 1 58.96.171.249 0.431 ms 0.538 ms 0.702 ms
 2 10.88.16.29 0.997 ms 1.030 ms 10.88.16.21 1.309 ms
 3 58.96.160.246 0.393 ms 0.390 ms 58.96.160.250 0.423 ms
 4 63.218.56.237 1.110 ms 202.123.74.122 0.440 ms 0.440 ms
 5 63.223.15.90 1.744 ms 63.218.56.237 1.076 ms 1.232 ms
 6 63.223.15.158 1.832 ms 63.223.15.90 1.663 ms 63.223.15.74 1.616 ms
 7 202.97.122.113 2.776 ms 63.223.15.154 1.585 ms 1.606 ms
 8 * * 202.97.122.113 2.537 ms
 9 202.97.61.237 6.856 ms * *
10 * * *
11 * * *
12 * * 119.147.220.222 8.738 ms
13 119.147.220.230 8.248 ms 8.231 ms *
14 * 42.120.242.230 32.305 ms 42.120.242.226 29.877 ms
15 42.120.242.234 11.950 ms 42.120.242.222 23.853 ms 42.120.242.218 29.831 ms
16 42.120.253.2 11.007 ms 42.120.242.234 13.615 ms 42.120.253.2 11.956 ms
17 42.120.253.14 21.578 ms 42.120.253.2 13.236 ms *
18 * * 223.5.5.5 12.070 ms !X

參數(shù)說(shuō)明

-n 直接使用 IP 地址而非主機(jī)名稱(禁用 DNS 反查)。

-T 通過(guò) TCP 探測(cè)。

-p 探測(cè)目標(biāo)端口號(hào)。

Host 目標(biāo)服務(wù)器域名或 IP。

更多關(guān)于 traceroute 的用法,您可以通過(guò)man幫助查閱。

Windows 環(huán)境下端口可用性探測(cè)工具介紹

Windows 環(huán)境下,您可通過(guò) tracetcp 進(jìn)行端口可用性探測(cè)。

tracetcp 同樣通過(guò)發(fā)送 TCP 數(shù)據(jù)包進(jìn)行鏈路探測(cè),以分析是否有鏈路中間節(jié)點(diǎn)對(duì)目標(biāo)端口做了阻斷。

下載安裝

tracetcp 的使用依賴于 WinPcap library,因此,您需要前往官網(wǎng)下載。

點(diǎn)擊此處前往官網(wǎng)下載最新版 tracetcp?;蛘?,您也可以下載附件 v1.0.2 版 tracetcp(可能并非最新版)。

將下載的 tracetcp 相關(guān)文件直接解壓到 C:\Windows 目錄。(如果解壓到非系統(tǒng)目錄,則需要手工修改系統(tǒng)環(huán)境變量,以確保指令可以直接調(diào)用)

使用方法

雙擊打開(kāi) tracetcp 應(yīng)用程序,tracetcp 的常見(jiàn)用法如下:

tracetcp <目標(biāo)服務(wù)器域名或 IP>:<待探測(cè)端口號(hào)>

示例

C:\ >tracetcp www.aliyun.com:80
Tracing route to 140.205.63.8 on port 80
Over a maximum of 30 hops.
1    3 ms  4 ms  3 ms  30.9.176.1
2    13 ms  3 ms  4 ms  10.64.200.33
3    3 ms  3 ms  2 ms  10.64.1.1
4    4 ms  3 ms  3 ms  42.120.74.4
5    5 ms  4 ms  7 ms  42.120.253.233
6    6 ms  5 ms  7 ms  42.120.247.97
7    8 ms  8 ms  8 ms  42.120.247.97
8    10 ms  10 ms  8 ms  123.56.34.246
9    9 ms  9 ms  11 ms  42.120.243.117
10   *    *    *    Request timed out.
11   Destination Reached in 8 ms. Connection established to 140.205.63.8
Trace Complete.

關(guān)于更多 tracetcp 參數(shù)說(shuō)明,您可以通過(guò) tracetcp -? 獲取和查看。

端口可用性探測(cè)步驟

通常情況下,您可以:

根據(jù)前文所述,使用對(duì)應(yīng)工具對(duì)目標(biāo)地址的目標(biāo)端口進(jìn)行可用性探測(cè)。

排查分析探測(cè)結(jié)果,確定異常節(jié)點(diǎn)。

通過(guò) ip.taobao.com 等 IP 地址查詢網(wǎng)站獲取相應(yīng)節(jié)點(diǎn)歸屬運(yùn)營(yíng)商及網(wǎng)絡(luò)。

或者提交工單,阿里云將為您向相關(guān)運(yùn)營(yíng)商反饋問(wèn)題。

鏈路測(cè)試結(jié)果分析簡(jiǎn)述

異常節(jié)點(diǎn)判定方法:如果相關(guān)端口在某一跳被阻斷,則其后各跳均不會(huì)返回?cái)?shù)據(jù)。據(jù)此就可以判定出異常節(jié)點(diǎn)。

示例1

C:\&;gt;tracetcp www.aliyun.com:135
Tracing route to 115.239.210.27 on port 135
Over a maximum of 30 hops.
1    3 ms  3 ms  3 ms  30.9.176.1
2    4 ms  3 ms  3 ms  10.64.200.33
3    3 ms  3 ms  3 ms  10.64.1.1
4    *    *    *    Request timed out.
5    *    *    *    Request timed out.
6    *    *    *    Request timed out.
7    *    *    *    Request timed out.
8    *    *    *    Request timed out.
9    *    *    *    Request timed out.
10   *    *    *    Request timed out.
11   *    *    *    Request timed out.
12   *    *    *    Request timed out.
13   *    *    *    Request timed out.
14   *    *    *    Request timed out.
15   *    *    *    Request timed out.
16   *    *    *    Request timed out.
17   *    *    *    Request timed out.
18   *    *    *    Request timed out.
19   *    *    *    Request timed out.
20   *    *    *    Request timed out.
21   *    *    *    Request timed out.
22   *    *    *    Request timed out.
23   *    *    *    Request timed out.
24   *    *    *    Request timed out.
25   *    *    *    Request timed out.
26   *    *    *    Request timed out.
27   *    *    *    Request timed out.
28   *    *    *    Request timed out.
29   *    *    *    Request timed out.
30   *    *    *    Request timed out.
Trace Complete.

上述探測(cè)數(shù)據(jù)中,目標(biāo)端口在第 3 跳之后就沒(méi)有數(shù)據(jù)返回。說(shuō)明相應(yīng)端口在該節(jié)點(diǎn)被阻斷。

示例結(jié)論:因?yàn)樵摴?jié)點(diǎn)為內(nèi)網(wǎng) IP,可能是本地網(wǎng)絡(luò)相關(guān)安全策略所致,您需要聯(lián)系本地網(wǎng)絡(luò)管理人員做進(jìn)一步排查分析。

示例2

[root@mycentos ~]# traceroute -T -p 135 www.baidu.com
traceroute to www.baidu.com (111.13.100.92), 30 hops max, 60 byte packets
 1 * * *
 2 192.168.17.20 (192.168.17.20) 4.115 ms 4.397 ms 4.679 ms
 3 111.1.20.41 (111.1.20.41) 901.921 ms 902.762 ms 902.338 ms
 4 111.1.34.197 (111.1.34.197) 2.187 ms 1.392 ms 2.266 ms
 5 * * *
 6 221.183.19.169 (221.183.19.169) 1.688 ms 1.465 ms 1.475 ms
 7 221.183.11.105 (221.183.11.105) 27.729 ms 27.708 ms 27.636 ms
 8 * * *
 9 * * *
10 111.13.98.249 (111.13.98.249) 28.922 ms 111.13.98.253 (111.13.98.253) 29.030 ms 28.916 ms
11 111.13.108.22 (111.13.108.22) 29.169 ms 28.893 ms 111.13.108.33 (111.13.108.33) 30.986 ms
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *

上述探測(cè)數(shù)據(jù)中,目標(biāo)端口在第 11 跳之后就沒(méi)有數(shù)據(jù)返回。說(shuō)明相應(yīng)端口在該節(jié)點(diǎn)被阻斷。

示例結(jié)論:因?yàn)樵摴?jié)點(diǎn)經(jīng)查詢歸屬北京移動(dòng),所以您需要自行排查,或者提交工單做進(jìn)一步排查分析。

標(biāo)簽:山南 煙臺(tái) 黃山 通遼 湘潭 湖北 賀州 懷化

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《linux解決ping通但端口不通的問(wèn)題》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    宜阳县| 河池市| 寻甸| 临江市| 长治县| 彰武县| 方正县| 汤原县| 深州市| 合山市| 大田县| 萨嘎县| 明水县| 高要市| 托克逊县| 三亚市| 长治县| 根河市| 延津县| 静安区| 邵阳县| 离岛区| 和平区| 济宁市| 新建县| 河北省| 玛纳斯县| 扎赉特旗| 康保县| 米林县| 富民县| 南昌市| 定襄县| 佛教| 桐柏县| 霍山县| 龙里县| 铜山县| 临邑县| 赤城县| 同江市|