How to change Ping TTL value on macOS

Time-to-live (TTL) is the number of hops that a package is set to exist in a network before it is discarded by the router if it does not find the destination host.

If you wish to change the value of this on your macOS to carry out a ping, you can make use of the sysctl command as follows,

% sudo sysctl net.inet.ip.ttl=100

net.inet.ip.ttl: 100 -> 92
Change TTL for ping on macOS

Note: If you do not sudo, you will get an error like

sysctl: net.inet.ip.ttl=92: Operation not permitted

This command has been tested on macOS Big Sur, Monterey, and Ventura

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap