OpenWRT - Change TTL (Time to Live) - Hop Limit

  Рет қаралды 21,384

Van Tech Corner

Van Tech Corner

Күн бұрын

In this video, we are going to change the TTL value on OpenWRT. Time to live (TTL) is the amount of time or “hops” that a packet is set to exist inside a network before being discarded by a router.
If you are using USB tethering, there is a specific TTL value that need to be configured. The common TTL value used by the mobile network operator is 65 while the default value on the computer is 128. We need to change this to have a working internet connection or to be able to use the hotspot. Changing TTL does not 100% give you unlimited hotspot with high speed but it depends on your network operator. You can check out videos about OpenWRT USB tethering or OpenWRT LTE module configuration and combine with this tutorial for a better usage.
- Custom Firewall rule:
iptables -t mangle -I POSTROUTING -o wan-interface -j TTL --ttl-set 65
- Edit /etc/sysctl.conf file and add in (in this example TTL 65 is used)
net.ipv4.ip_default_ttl=65
net.ipv6.ip_default_ttl=65
Your can learn more about TTL at:
www.cloudflare.com/learning/c...
Video timeframe:
00:00 - Introduction to TTL changing on OpenWRT
00:17 - Change TTL with Firewall Custom Rule
02:03 - Change TTL by modifying sysctl.conf file
03:11 - Test and final words
Feel free to check out other unbox videos & tutorials on my channel.
If there is anything not clear or there is any question, please leave it in the comment section and we will discuss.
If you see my work is helpful and want to support me, kindly send it to:
paypal.me/vantechcorner
A small group on FB, join if you want to say hi: / 786305722225040
As always, please like, share and subscribe to the channel! Thank you!

Пікірлер: 65
@savviemommy
@savviemommy 10 ай бұрын
I was trying several other ways, I didn't realize OpenWRT had iptables. You saved me alot of headache. Thanks
@VanTechCorner
@VanTechCorner 10 ай бұрын
Glad to help
@Prof.LamMath
@Prof.LamMath Жыл бұрын
Love it, finally solve my problem, I used the last method via Mac terminal, easy
@huijinlee7120
@huijinlee7120 3 жыл бұрын
A very useful tutorial. Thanks bro. U r really awesome
@VanTechCorner
@VanTechCorner 3 жыл бұрын
Glad you liked it!
@peakdevice8820
@peakdevice8820 3 жыл бұрын
THANKYOU i appreciate this just noticed you did this video
@VanTechCorner
@VanTechCorner 3 жыл бұрын
You are welcome. Editing the sysctl.conf file is faster and I always use it :D
@peakdevice8820
@peakdevice8820 3 жыл бұрын
@@VanTechCorner okay cool brother ill be sure to do so next time I’ll continue to watch a lot more of your videos very educational thanks 😊
@Chris-ms4hi
@Chris-ms4hi Жыл бұрын
Great work! Do you know how to change the TTL for both IPV4 and IPV6 in FW4 openWRT vs 22.03?
@spazza1270
@spazza1270 2 жыл бұрын
what are you using to edit the file after adding the firewall rule?
@zainalarif427
@zainalarif427 Жыл бұрын
Sometime in wisp mode , the inbound packet has ttl=1 can we use this to passing packet to next hop ?
@dopamyth
@dopamyth 3 жыл бұрын
hello van can you explain for COD cold war nat rules firewall rules and port forward internal port and external port destination i heard is 3074 and 30000-450000 , i'm use cake piece of cake on my sqm :) thanks
@heureusek9820
@heureusek9820 Жыл бұрын
i cannot set the firewall because there is no custom firewall tab. my fw is 22.03.3. pls advice hot to set firewall ttl 65 by using command in ssh, thx
@godzexist
@godzexist 2 жыл бұрын
for example should the ttl on windows be 66, then openwrt 65, then android 64?
@masudparveznirob287
@masudparveznirob287 2 жыл бұрын
my isp limited ttl=2 to prevent secondary router share.can i bypass this by this video?
@francocastilloAR
@francocastilloAR 2 жыл бұрын
An update would be missing since now they changed iptables to nftables.
@azuwan
@azuwan Жыл бұрын
I've this same router installed openwrt but bricked due to I pressed the reset button and it no longer boot. Tried to put it into recovery mode also failed. Can you make tutorial? Thanks
@boreneoman7728
@boreneoman7728 2 жыл бұрын
very informative. what value do i need to put on my android system if my phone is rooted, so i can tether my data to another 2nd phone without tweaking the 2nd phone?
@VanTechCorner
@VanTechCorner 2 жыл бұрын
Hi, if you want to do this with your phone, you can either setup a proxy server on the main phone or install pdanet+. Here is the playlist, just in case you need it kzbin.info/aero/PL58__w3t_eTbaPnGpJu9CArOtZGLEzVJ8
@o2cool321
@o2cool321 3 жыл бұрын
Any idea on how to run a custom http header request using DD-WRT or openWRT?
@VanTechCorner
@VanTechCorner 3 жыл бұрын
Hey, no idea for now I am looking for it. I'll let you know if there is anything new.
@luqmanhaqim97
@luqmanhaqim97 3 жыл бұрын
I have a question, if my router has a sim card slot, does the sysctl method allows all of the device connected use the same ttl?
@VanTechCorner
@VanTechCorner 3 жыл бұрын
Yes, if you are using the normal unlimited plan that does not allow hotspot, you can change the TTL and all connected devices will be able to surf the internet.
@luqmanhaqim97
@luqmanhaqim97 3 жыл бұрын
@@VanTechCorner Alright noted, thanks for answering. 👍
@VanTechCorner
@VanTechCorner 3 жыл бұрын
You're welcome!
@SameLif3
@SameLif3 3 жыл бұрын
Van Tech Corner I’ve noticed that I need a router for this to work? Could I get any router and it’ll work?
@hidden5200
@hidden5200 2 жыл бұрын
i heard ipv6 not using ttl but hop limit (hl) , is that okay using "ttl" to fix hop limit? yes i know theres no much differen, just term...im curious
@shaeccha6072
@shaeccha6072 4 ай бұрын
yes corrent. ttl for ipv4, hl for ipv6
@Herik.
@Herik. 3 жыл бұрын
Please make TTL in prerouting is 10 for more stable and make TTL in postrouting is 65 or u can set it like windows is 128. Thanks
@VanTechCorner
@VanTechCorner 3 жыл бұрын
Hi, you just need to change the Firewall rule according to what you need. The syntax is already there "iptables -t mangle -I POSTROUTING -o wan-interface -j TTL --ttl-set 65" => POSTROUTING is set to 65 in this case.
@jhojanfernandez1709
@jhojanfernandez1709 2 жыл бұрын
I went through the whole procedure and it still doesn't connect me to the internet, why?
@mohdilyasyusoff1476
@mohdilyasyusoff1476 3 жыл бұрын
hi if using QMI is it using eth0 or USB0 or according to ttyUSB?
@VanTechCorner
@VanTechCorner 3 жыл бұрын
It should be ttyUSB for the modem serial interface. You can check the QMI / 3G tutorial on this playlist as well - kzbin.info/aero/PL58__w3t_eTbcBQ9oJ8jXCxPtBiac59vC
@luisjosue1989
@luisjosue1989 3 жыл бұрын
This works if i have a bridge between wan0 and usb0 ?
@VanTechCorner
@VanTechCorner 3 жыл бұрын
Yes it work. You can follow the 2nd way to modify the configuration file and the TTL will be applied for all interfaces.
@PalataoArmy
@PalataoArmy Жыл бұрын
in openwrt 22.03, the custom rules is missing.
@VanTechCorner
@VanTechCorner Жыл бұрын
Hello, you can follow the 2nd guide, starts at 2:04
@azzubair8130
@azzubair8130 3 жыл бұрын
Hi sir, I have follow your guide, but why the hotspot still leak? Using B618 to Dir 842 router
@VanTechCorner
@VanTechCorner 3 жыл бұрын
Hi, I am not really understand your question. What do you mean by leak? Did you change the TTL for all interfaces or just the WAN interface?
@azzubair8130
@azzubair8130 3 жыл бұрын
@@VanTechCorner i just follow your guide... but nevermind, I fixed it with the rule below, but the speed become dropped, can you advise? # flush tables iptables -F iptables -t nat -F -t mangle # apply routing iptables -t nat -A POSTROUTING -o eth0.2 -j MASQUERADE iptables -t mangle -A PREROUTING -j TTL --ttl-set 65 iptables -A FORWARD -i eth0.2 -o br-lan -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i eth0.2 -o br-lan -j ACCEPT
@zenmaster5850
@zenmaster5850 Жыл бұрын
how to set it in asus router pls?
@nguyenvanson__chdi1a913
@nguyenvanson__chdi1a913 Жыл бұрын
ssh change cmd ?
@LongHoang-dk3ex
@LongHoang-dk3ex Жыл бұрын
cho mình hỏi bản openwrt 22.03 không có mục Custom Rules trong Firewall nữa thì mình phải chỉnh sửa nó ntn vậy bn ?
@VanTechCorner
@VanTechCorner Жыл бұрын
Có hai cách để thay đổi TTL, bạn làm theo cách hai không cần custom rules nha.
@godzexist
@godzexist 2 жыл бұрын
if i ping android ip (pc - 65 ttl --> android 64 ttl) it gives me the android ip ttl of 64 / but if i do it like this (pc - 66 ttl -> openwrt 65 ttl -> android "technically 64") it gives me ttl of 63.
@shahrilmadara7794
@shahrilmadara7794 2 жыл бұрын
hello van, why after edit on terminal, i can't Esc
@VanTechCorner
@VanTechCorner 2 жыл бұрын
Hi, do you mean when editing the text with Vi editor? Can you tell me which time in the video so I can help.
@shahrilmadara7794
@shahrilmadara7794 2 жыл бұрын
@@VanTechCorner arount 2.48 - 2.50 in video after put net.ipv6.ip_default_ttl=65 and press button ESC..but in my case after push button ESC nothing happen..
@VanTechCorner
@VanTechCorner 2 жыл бұрын
Yes that's normal. Did you press :wq and Enter after that?
@adelkhalifa1104
@adelkhalifa1104 3 жыл бұрын
Sorry for the noob question, what is this all about?
@VanTechCorner
@VanTechCorner 3 жыл бұрын
Hello, it had been stated in the video and the description: If you are using USB tethering, there is a specific TTL value that need to be configured. The common TTL value used by the mobile network operator is 65 while the default value on the computer is 128. We need to change this to have a working internet connection or to be able to use the hotspot.
@VanTechCorner
@VanTechCorner 3 жыл бұрын
It is base on your network operator. But my answer is yes. You can follow the 2nd way by editing the configuration file and the TTL will be applied to all.
@jaimepaulobescaser8985
@jaimepaulobescaser8985 25 күн бұрын
@@VanTechCorner I have a question how about android phone limiting its hotspot capability? i dont now were to put TTL 2 on the firewall settings. my target is to limit of using the hotspot capability of the android phone either via Bluetooth and wifi hotspot sharing it self. hope you will notice this.
@nguyenvanson__chdi1a913
@nguyenvanson__chdi1a913 Жыл бұрын
bác ơi mở giao diện ssh bằng cmd được không bác ?
@VanTechCorner
@VanTechCorner Жыл бұрын
Được nha bạn. Trên Windows 10 bạn có thể dùng lệnh ssh để kết nối tới router. Ngoài ra bạn có thể tải Putty.
@godzexist
@godzexist 2 жыл бұрын
i believe there should be something wrong with the openwrt config
@tonebaxter
@tonebaxter 3 жыл бұрын
Can’t see...
@VanTechCorner
@VanTechCorner 3 жыл бұрын
Hi, please try to watch it on your PC or turn on the CC feature in KZbin and you can see the text in bigger size.
@rootmourad1133
@rootmourad1133 3 жыл бұрын
How to watch IPTV channels on an openwrt system 🙄
@VanTechCorner
@VanTechCorner 3 жыл бұрын
Hey, if IPTV is running on VLAN you will need to create VLAN on the router. The steps is almost the same with setting up LAN interface as WAN interface and you just need to setup the VLAN ID correctly. If it is running multicast then we have something more to talk about.
@rootmourad1133
@rootmourad1133 3 жыл бұрын
@@VanTechCorner I have tried several times to play free iptv chanes on the openwrt system. In VLC format on the phone. But that did not work. I'm waiting for you to post a video explaining the steps of setting up iptv. thanks in advance🙂
@VanTechCorner
@VanTechCorner 3 жыл бұрын
As I mentioned, you need to know if IPTV is running on VLAN or VLAN + multicast. If it work on multicast, you will need to setup IGMP proxy as well. For some internet service providers, IPTV only works on their GPON router and there is no way to setup it up on the third party router. If you have any question, please join the group "Van Tech Corner & Friends" on FB.
@markthompson6334
@markthompson6334 2 жыл бұрын
Videos with no directions verbally and small print are impossible to follow. This is an awful video. Try actually adding verbal instructions or zooming in so that it can actually be seen. I’m looking at this on a large iPad and it is still not legible
@VanTechCorner
@VanTechCorner 2 жыл бұрын
Are you going to configure your router with your iPad? My videos are made for desktop users with optimal resolution of 1920x1080. Still, you can find the script/command line in the video description.
@supernice_auto
@supernice_auto 2 жыл бұрын
@@VanTechCorner lmaooo
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН
Little girl's dream of a giant teddy bear is about to come true #shorts
00:32
Spot The Fake Animal For $10,000
00:40
MrBeast
Рет қаралды 153 МЛН
Must-Know FIX for Fallout 76's New MAP BUG
9:26
Addiction Gaming
Рет қаралды 12 М.
Limiting Connection Sharing with Change TTL - MIKROTIK TUTORIAL [ENG SUB]
12:08
Mikrotik Indonesia - Citraweb
Рет қаралды 37 М.
OpenWRT - Configure 802.11r Fast Transition - Fast Roaming Wifi
11:12
Van Tech Corner
Рет қаралды 30 М.
VLANs Explained | Cisco CCNA 200-301
11:16
CertBros
Рет қаралды 271 М.
Cómo crear un punto de acceso (Repetidor) con Openwrt
10:02
FIX @ CHANGE TTL OPENWRT
8:13
FZ
Рет қаралды 5 М.
MikroTips: How to firewall
21:56
MikroTik
Рет қаралды 142 М.
OpenWRT - Configure Load Balancing with mwan3
25:25
Van Tech Corner
Рет қаралды 35 М.
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 1,2 МЛН
НЕ БЕРУ APPLE VISION PRO!
0:37
ТЕСЛЕР
Рет қаралды 292 М.
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 3,6 МЛН
iPhone, Galaxy или Pixel? 😎
0:16
serg1us
Рет қаралды 1,3 МЛН
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
VA-PC
Рет қаралды 2,3 МЛН