ValentinBELYN / icmplib

Easily forge ICMP packets and make your own ping and traceroute.
GNU Lesser General Public License v3.0
267 stars 45 forks source link

traceroute: last hop ip different with dest address in output. #18

Closed ktaog6 closed 3 years ago

ktaog6 commented 3 years ago

Hi,

when i use traceroute module, the last address not my address in output, does it mean the address can't reach ? And Hop 3 to Hop 21 means 4~20 not response ?

Example:

Python 3.8.5 (default, Sep 22 2020, 23:34:13) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux Type "help", "copyright", "credits" or "license" for more information.

from icmplib import * traceroute("192.168.46.25") [<Hop 1 [193.22.152.1]>, <Hop 2 [172.16.0.11]>, <Hop 3 [192.168.101.42]>, <Hop 21 [38.142.238.113]>]

ValentinBELYN commented 3 years ago

Hi @ktaog6,

Yes, if the last address is not the one you want to reach, there are two possible causes:

For your second deduction, you are also right. Hosts 4 through 20 did not respond. Some routers, like these, are configured not to send ICMP Time Exceeded messages for security reasons.

I hope I've helped you.

ktaog6 commented 3 years ago

ok, thanks.