Skip to content

Instantly share code, notes, and snippets.

@farneser
Last active June 8, 2025 16:39
Show Gist options
  • Save farneser/3acdc050b59235e95c96802747b02113 to your computer and use it in GitHub Desktop.
Save farneser/3acdc050b59235e95c96802747b02113 to your computer and use it in GitHub Desktop.
How to change TTL on windows 10/11 in on command

Change windows 10/11 TTL in one command and reboot

netsh int ipv4 set glob defaultcurhoplimit=65

Check TTL value

ping 1.1.1.1

Use 1.1.1.1 or any IP

@FalsePhilosopher
Copy link

Thank you for posting this, it always take me forever to find this command online as everything states to do the reg change and I know there is a single command to do this out there lol. Mad props!

@braveltd
Copy link

Thank you, that works. Only problem - how to check that system really uses it? I'm not sure if ping 127.0.0.1 (showing 65) really works. because after checks in wsl - it's 64 (-1 because of wsl probably).

so if i use ping in windows cmd.exe -> this is for system-wide?
that way - if i also change wsl's ttl to 64 -> 65, that way - wsl is fine as well?

@farneser
Copy link
Author

Thank you, that works. Only problem - how to check that system really uses it? I'm not sure if ping 127.0.0.1 (showing 65) really works. because after checks in wsl - it's 64 (-1 because of wsl probably).

so if i use ping in windows cmd.exe -> this is for system-wide? that way - if i also change wsl's ttl to 64 -> 65, that way - wsl is fine as well?

I'm not sure that TTL is distributed to WSL, it needs to be checked. When a request comes in, it queries the system to see what ttl it has, so I think that the updated TTL will still remain inside Windows and on WSL the standard value

@braveltd
Copy link

@farneser я проверил, в самой wsl TTL стоит стандартный (тоесть 64), но все запросы идущие с нее -> идут в винду, отчего получается так, что если в винде у тебя TTL 65 -> все запросы с wsl будут тоже 65, неважно какой TTL в wsl.

поэтому используя одного, говно провайдера - МТС)))

лимитов нету. в противном случае (если TTL не 65) они бы были.

@ejrydhfs
Copy link

ejrydhfs commented Mar 14, 2025

It doesn't seem to be permanent in windows 11

Edit to make it permanent make sure you run the command in PowerShell as an administrator.

@farneser
Copy link
Author

It doesn't seem to be permanent in windows 11

Edit to make it permanent make sure you run the command in PowerShell as an administrator.

After what period does it reset TTL or what is the trigger for this?

@Zora-Z0
Copy link

Zora-Z0 commented Apr 3, 2025

I am not sure if its from a windows update but as of 04/03/25 this is not working in Win11or Win10. Not sure if others are experiencing this as well. I also ran PowerShell and CMD with admin rights and ttl still does not change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment