16

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]
    "DefaultTTL"=dword:00000081
    
  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?

24

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

Or:

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

Or:

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:

net.ipv4.ip_default_ttl=129
| improve this answer | |
  • 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 '18 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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