Publish: 2022-11-26 | Modify: 2022-11-26
telnet command can test the TCP port connectivity. Recently, I found that telnet is able to connect to any IP address and port in my home network environment, which seems a bit abnormal.
For example, I telnet to the IP address of Baidu: 14.215.177.38
, and then specify a random port 7890
. Baidu does not open port 7890
, so it should not be possible to establish a connection. However, the telnet test result shows that it is successful.
I tried using another Linux machine, and the result is still successful.
So I used WireShark to capture packets and found that the TCP three-way handshake was successful, but there was a retransmission, which is confusing.
The main router I am using is iKuai. I suspected that it might be related to the router, so I consulted iKuai's customer service. Here is the response I received (kudos to iKuai's customer service for their prompt response and problem resolution).
According to iKuai's explanation, the issue is caused by "Flow Control Shunt - Protocol Shunt - Enhanced Shunt" which can lead to the malfunction of certain functions. So after disabling "Enhanced Shunt", the issue is resolved.
However, the root cause of the problem is still unknown. I posted a question on V2EX, and most of the answers suggested that it might be caused by transparent proxy. Therefore, I speculate that iKuai's "Enhanced Shunt" is implemented through a transparent proxy, which hijacks all the traffic to the proxy server (not verified).
If you also experience the issue of telnet being able to connect to any IP address and port, you can try the following troubleshooting steps:
I come from China and I am a freelancer. I specialize in Linux operations, PHP, Golang, and front-end development. I have developed open-source projects such as Zdir, ImgURL, CCAA, and OneNav.