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 is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

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