My goal is to check weather the destination port (MySQL 3306) is able to connect.
First, I tried with telnet but it showed No route to host
$ telnet dest.com 3306
Trying <dest_ip>...
telnet: Unable to connect to remote host: No route to host
However, it can be connected with port 80.
$ telnet dest.com 80
Trying <dest_ip>...
Connected to dest.com.
Escape character is '^]'.
So, I tried with normal traceroute and the destination is not reachable.
$ traceroute dest.com
traceroute to dest.com (<dest_ip>), 30 hops max, 60 byte packets
1 172.16.101.1 (172.16.101.1) 0.283 ms 0.553 ms 0.345 ms
2 * * *
3 * * *
...
However, when I tried with traceroute -T -p, the destination is appeared to be reachable.
$ traceroute -T -p 3306 dest.com
traceroute to dest.com (<dest_ip>), 30 hops max, 60 byte packets
1 172.16.101.1 (172.16.101.1) 0.270 ms 0.374 ms 0.468 ms
2 <public_ip> (<public_ip>) ....
3 <public_ip2> (<pubice_ip2>) ...
4 ...
5 <dest_ip> (dest_ip) 4.144 ms !X 4.217 ms !X 3.996 !X
And, when I tried with other port, the route is different (just one hop away).
$ traceroute -T -p 80 dest.com
traceroute to dest.com (<dest_ip>), 30 hops max, 60 byte packets
1 172.16.101.1 (172.16.101.1) 0.327 ms 0.438 ms 0.568 ms
2 <dest_ip> (dest_ip) 0.711 ms 0.865 ms 0.974 ms
So, I wonder how traceroute -T -p
work and what are the reasons of the results in each step?