I need to change TTL on my Mac, if I connect iPhone as a wi-fi modem. Now I am using this command:
sudo sysctl -w net.inet.ip.ttl=65
Also I need to change TTL back to 64 when I connect to other wi-fi. But I want to automate it. Is there any bash script for that? (MacBook Pro 2020, Mac OS Catalina 10.15.7). Sorry for bad English, it isn't my native language.