How to Change the Default TTL Value Set On Ping Packets?

Updated by: Alex George on March 04, 2025

Welcome to the network engineering tutorial section by CoreNetworkZ Tech Solutions. Today, I will teach you how to change the default TTL value of a ping packet.

Let me start this article by explaining the term TTL. TTL stands for Time to Live, the maximum number of hops (routers) the packet can cross before expiration.


Do I Need to Manipulate the 'Time To Live' Value of a Ping Packet?

Let us start this section with this question. Michele Montobbio asked about it in the comment section.

TTL = Time To Live

While troubleshooting connectivity issues, we may need to change the default TTL value set on the Ping packets. It is because the TTL value (Time To Live) tells the life span of the ping packets.

In simple words, it is the number of hops they can cross.

When it reaches the hop count set by TTL, it expires. This tutorial explains how to assign a new Time To Live value to a Ping packet and the after-effects of this process.


When Should I Assign a New TTL Value?

Matteo Vettraino, a CCNA student, asked when he should change the TTL value. Let me explain it.

When you ping an address from the Command Prompt, your computer automatically assigns a default Time To Live value (a number greater than the hop count between the destination and your computer).

Sometimes, the default TTL value might not be enough for the packets to reach the final destination. Then, we must set a different Time To Live value on them.

I guess I answered Matteo Vettraino's question.


Ping TTL Value Maximum Limit

Thomas George Pakalomattam asked the maximum TTL value he could set. His second question was where he could change it.

TTL Value Range is 1 to 255.

We can change this value from the command prompt, but the manually configured value must be between 1 and 255. If the TTL set is 0, ping packets won't go further from your computer. If it is 1, they expire when they reach the subnet.


Can I Find the Hop Count Between My PC and a Website Server?

One of my regular readers, Simone Vanin, suggested adding one practical use for analyzing a packet's TTL value. So, let me share one such practical use.

From the Time To Live value in the ping reply, we can find the hop count between the destination and your computer.

Check this image to learn how to find the hop count between your computer and different websites.

Extend the ping set ttl value

In this experiment, I sent ping packets to different websites. The results show the distance between my computer and Google, Yahoo, and CoreNetworkZ.com.

I suggest Simon Vanin check the values inside the red circle. That TTL value is the number of hops between my computer and the website server. I hope Simon is satisfied with this practical use.


How To Change The Default TTL Value When You Ping an Address?

Let us come back to the main topic. In this section, I will teach you how to manipulate the TTL value on a ping packet.

Use the command below to change the default Time To Live value set on ICMP echo packets.


Ping -i (TTL value) Address


By this command, you can reduce or extend the TTL value of a ping packet.

Example: Ping Google.com -i 100


If you set a lower TTL value, ping packets will never reach the destination. Check the screenshot below to see the experiment results.

How to limit ttl value?

Here, I set a TTL value that is less than the hop count between my computer and Google server. So, the packets expired before reaching the destination, and I received the Time To Live Expired in Transit error message.

Reference

  1. https://learningnetwork.cisco.com/s/question/0D53i00000Kt6juCAB/ttl-value
  2. https://www.juniper.net/documentation/us/en/software/junos/user-access/topics/example/dns-ttl-value-configuring.html

11 comments:

  1. Anonymous11:21 AM

    Thanks for sharing this test

    Amit

    ReplyDelete
    Replies
    1. Hi, I'm writing through a translator. When I enter a ping command for sites like youtube or google, a different TTL value is used, as I understand this is why the approximate receive-transmit time in ms changes. The receive-transmit time for YouTube is approximately 15ms, but for api.telegram.org this value reaches 70ms, this is very bad for me and I would like to either remove this delay altogether or reduce it to 5-10, is this possible? TTL for api.telegram.org is 54

      Delete
    2. Do you use any proxy or VPN to connect to the Internet?

      If yes, disable it and ping again.

      Delete
  2. Thomas George Pakalomattam9:20 AM

    Hello Alex,

    It was a helpful tutorial. I learned a lot from you. I want to know the maximum possible ttl value I can set. Which terminal I should use to change the ttl value?

    ReplyDelete
    Replies
    1. Hello Thomas,

      Welcome to CoreNetworkZ Tech Solutions. The TTL value must be between 1 and 255. You can use Command Prompt to change the TTL value. I explained it in the article.

      Delete
  3. Simone Vanin9:23 AM

    Hi Alex,

    A great article from you as usual. Can you suggest one practical usage of this command you explained in the article?

    ReplyDelete
    Replies
    1. Hello Simon,

      Thank you for your comment. I have updated the article with a practical use.

      Delete
  4. Michele Montobbio9:26 AM

    Do I really need TTL manipulation?

    ReplyDelete
    Replies
    1. Hello Michele,

      Welcome to CoreNetworkZ Tech Solutions. Yes, sometimes we require a TTL value manipulation.

      Delete
  5. Matteo Vettraino9:30 AM

    Hello Alex,

    I have started my CCNA course and have doubts about when should someone change the ping ttl value.

    ReplyDelete
    Replies
    1. Hello Matteo,

      I explained it in the article. Thank you for your comment.

      Delete

Newer Post Older Post Home