I need to change the default TTL of TCP/IP packets sent from my Ubuntu computer. I found the solution for Windows:

  1. To make reg-file:

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\servic es\Tcpip\Parameters]
  2. To execute this commands in console:

    netsh int ipv4 set glob defaultcurhoplimit=129
    netsh int ipv6 set glob defaultcurhoplimit=129

The question is how should I translate this solution for Ubuntu?

up vote 14 down vote accepted

To change the default TTL of TCP/IP packets sent from your Linux computer you can run the following command:

sudo sysctl net.ipv4.ip_default_ttl=129


echo 129 | sudo tee /proc/sys/net/ipv4/ip_default_ttl


sudo bash -c 'echo 129 > /proc/sys/net/ipv4/ip_default_ttl'

But you have to run one of those commands whenever the computer boots. To make this setting persistent across reboots you could append the following line to the file /etc/sysctl.conf:

  • I used nano to edit /proc/sys/net/ipv4/ip_default_ttl and now I can't see any of my wifi networks – Arya Jul 3 at 3:47

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.