Skip to content

Instantly share code, notes, and snippets.

@cfluegel
Forked from mueslimak3r/ttl-mods.txt
Created September 4, 2023 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfluegel/c31a0f4f0219fa37b9affdf63abd656a to your computer and use it in GitHub Desktop.
Save cfluegel/c31a0f4f0219fa37b9affdf63abd656a to your computer and use it in GitHub Desktop.
ttl mods for mangling TTL behind an LTE modem
# iptables rules for mangling ipv4 and ipv6 traffic
# prerouting rules appear to prevent leaks to the ISP
iptables -t mangle -I PREROUTING 1 -j TTL --ttl-set 65
ip6tables -t mangle -I PREROUTING 1 -j HL --hl-set 65
# postrouting rules do the heavy lifting
iptables -t mangle -I POSTROUTING 1 -j TTL --ttl-set 65
ip6tables -t mangle -A POSTROUTING 1 -j HL --hl-set 65
# modem decrements TTL from 65 to 64, which is what the ISP sees :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment