在某些情况下,我们购买了php中文网服务器轻量应用服务器无忧计划后,可能会在特定地区或使用移动数据网络时无法访问到服务器上的web网站。例如下图所示:

我们发现直接通过服务器的公网IP访问也无法连接到网站,这时可以排除域名解析的问题。即使使用ping和tracert命令测试网络连接是通畅的,但仍然无法连接到网站。需要注意的是,ping使用的是ICMP协议,位于OSI模型的网络层,而tracert则使用ICMP协议和IP包头中的TTL字段来确定从一个主机到网络上其他主机的路由,这些都属于网络层协议。然而,客户端连接云服务器上的web业务需要上升到传输层(TCP协议)和应用层(HTTP、HTTPS协议)。因此,我们需要进行传输层的端口路由追踪来检查网络在传输层是否正常传输,这就需要使用Windows中的tracetcp软件。本文将指导大家在Windows上安装并使用tracetcp软件,并介绍一些基本的命令。
tracetcp v1.0.3软件下载:tracetcp_v1.0.3 (1).zip WinPcap 4.1.3软件下载:WinPcap_4_1_3.zip
tracetcp安装教程: ①、下载本文提供的tracetcp软件后,将tracetcp.exe解压。
②、解压后,将tracetcp.exe放到C:\Windows\System32目录下。
③、在Windows上安装WinPcap,这是Windows数据包捕获的依赖库,必须安装。
下载本文提供的最新版本的WinPcap后,打开WinPcap,点击“next”进行下一步安装。
点击“I Agree”继续下一步。
勾选下图的红框标识,然后点击“install”进行安装。
点击“finish”完成安装。

tracetcp常用用法示例: ①、打开cmd。
②、输入tracetcp www.baidu.com:443 -n。
这表示在本地对百度的TCP 443端口发送TCP SYN包进行探测,并追踪路由,-n选项表示不将IP反解析为域名,直接显示IP,方便自己或工程师分析路径中经过的节点设备。

tracetcp完整参数说明:
tracetcp host [options]
where host = hostName|ipAddress[:portNumber|serviceName]
if portNumber or serviceName is not present then port 80 (http) is assumed.
Options:
-? Displays help information.
-c Select condensed output mode.
-h start_hop Starts trace at hop specified.
-m max_hops Maximum number of hops to reach target.
-n No reverse DNS lookups for each node.
-p num_pings # of pings per hop (default 3).
-r p1 p2 Multiple traces from port p1 to p2.
-t timeout Wait timeout milliseconds for each reply.
-v Displays version information.
-s p1 p2 Easy port scan mode. gives the same result as setting the following options:
-cnr p1 p2 -h 128 -m 1 -p 1
-F Disables the Anti-flood timer. Normally tracetcp waits *at least* 0.5 seconds between sending out each packet, because if the packets are sent too fast some host seem to detect this as some form of flood and stop responding for a time. This option disables the 0.5 second timer, so the traces occur faster.
-R Use raw socket interface to send/receive packets. This will not work on XP SP2. (You still need WinPcap installed)
-g address Use the specified host as a gateway to remote systems rather than the default gateway.
Examples:
tracetcp www.microsoft.com:80 -m 60
tracetcp post.sponge.com:smtp
tracetcp 192.168.0.1 -n -t 500以上就是腾讯云windows使用tracetcp进行目标IP tcp 端口路由追踪的详细内容,更多请关注php中文网其它相关文章!
Windows激活工具是正版认证的激活工具,永久激活,一键解决windows许可证即将过期。可激活win7系统、win8.1系统、win10系统、win11系统。下载后先看完视频激活教程,再进行操作,100%激活成功。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号