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


Have Questions? Post them here!

Top Hashtags: