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

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.พ. 2025

ความคิดเห็น • 72

  • @savviemommy
    @savviemommy ปีที่แล้ว +1

    I was trying several other ways, I didn't realize OpenWRT had iptables. You saved me alot of headache. Thanks

  • @ToTheMaxWorld
    @ToTheMaxWorld 2 หลายเดือนก่อน

    interestingly i had done this on my macbook and skipped the router but updating to sequoia isnt allowing me to do that and bypass throttling

  • @Chris-ms4hi
    @Chris-ms4hi 2 ปีที่แล้ว +5

    Great work! Do you know how to change the TTL for both IPV4 and IPV6 in FW4 openWRT vs 22.03?

  • @Prof.LamMath
    @Prof.LamMath 2 ปีที่แล้ว

    Love it, finally solve my problem, I used the last method via Mac terminal, easy

  • @heureusek9820
    @heureusek9820 2 ปีที่แล้ว +1

    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

  • @huijinlee7120
    @huijinlee7120 4 ปีที่แล้ว +2

    A very useful tutorial. Thanks bro. U r really awesome

  • @lands1459
    @lands1459 3 หลายเดือนก่อน

    iptables: command not found
    i also dont have custom firewall rules

  • @peakdevice8820
    @peakdevice8820 4 ปีที่แล้ว +1

    THANKYOU i appreciate this just noticed you did this video

    • @VanTechCorner
      @VanTechCorner  4 ปีที่แล้ว +1

      You are welcome. Editing the sysctl.conf file is faster and I always use it :D

    • @peakdevice8820
      @peakdevice8820 4 ปีที่แล้ว +1

      @@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 😊

  • @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

  • @PalataoArmy
    @PalataoArmy 2 ปีที่แล้ว +2

    in openwrt 22.03, the custom rules is missing.

    • @VanTechCorner
      @VanTechCorner  2 ปีที่แล้ว +2

      Hello, you can follow the 2nd guide, starts at 2:04

  • @francocastilloAR
    @francocastilloAR 2 ปีที่แล้ว +1

    An update would be missing since now they changed iptables to nftables.

  • @luqmanhaqim97
    @luqmanhaqim97 4 ปีที่แล้ว +1

    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  4 ปีที่แล้ว +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 4 ปีที่แล้ว

      @@VanTechCorner Alright noted, thanks for answering. 👍

    • @VanTechCorner
      @VanTechCorner  4 ปีที่แล้ว +1

      You're welcome!

  • @masudparveznirob287
    @masudparveznirob287 3 ปีที่แล้ว

    my isp limited ttl=2 to prevent secondary router share.can i bypass this by this video?

  • @zainalarif427
    @zainalarif427 2 ปีที่แล้ว

    Sometime in wisp mode , the inbound packet has ttl=1 can we use this to passing packet to next hop ?

  • @godzexist
    @godzexist 3 ปีที่แล้ว

    for example should the ttl on windows be 66, then openwrt 65, then android 64?

  • @jhojanfernandez1709
    @jhojanfernandez1709 3 ปีที่แล้ว

    I went through the whole procedure and it still doesn't connect me to the internet, why?

  • @dopamyth
    @dopamyth 4 ปีที่แล้ว +1

    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

  • @boreneoman7728
    @boreneoman7728 3 ปีที่แล้ว

    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  3 ปีที่แล้ว

      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 th-cam.com/play/PL58__w3t_eTbaPnGpJu9CArOtZGLEzVJ8.html

  • @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 11 หลายเดือนก่อน

      yes corrent. ttl for ipv4, hl for ipv6

  • @spazza1270
    @spazza1270 3 ปีที่แล้ว

    what are you using to edit the file after adding the firewall rule?

  • @azzubair8130
    @azzubair8130 4 ปีที่แล้ว

    Hi sir, I have follow your guide, but why the hotspot still leak? Using B618 to Dir 842 router

    • @VanTechCorner
      @VanTechCorner  4 ปีที่แล้ว

      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 4 ปีที่แล้ว

      @@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

  • @nguyenvanson__chdi1a913
    @nguyenvanson__chdi1a913 2 ปีที่แล้ว

    ssh change cmd ?

  • @zenmaster5850
    @zenmaster5850 2 ปีที่แล้ว

    how to set it in asus router pls?

  • @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 - th-cam.com/play/PL58__w3t_eTbcBQ9oJ8jXCxPtBiac59vC.html

  • @luisjosue1989
    @luisjosue1989 3 ปีที่แล้ว

    This works if i have a bridge between wan0 and usb0 ?

    • @VanTechCorner
      @VanTechCorner  3 ปีที่แล้ว +1

      Yes it work. You can follow the 2nd way to modify the configuration file and the TTL will be applied for all interfaces.

  • @adelkhalifa1104
    @adelkhalifa1104 4 ปีที่แล้ว

    Sorry for the noob question, what is this all about?

    • @VanTechCorner
      @VanTechCorner  4 ปีที่แล้ว

      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  4 ปีที่แล้ว

      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 7 หลายเดือนก่อน

      @@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.

  • @Herik.
    @Herik. 4 ปีที่แล้ว +1

    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  4 ปีที่แล้ว

      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.

  • @LongHoang-dk3ex
    @LongHoang-dk3ex 2 ปีที่แล้ว

    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  2 ปีที่แล้ว +1

      Có hai cách để thay đổi TTL, bạn làm theo cách hai không cần custom rules nha.

  • @shahrilmadara7794
    @shahrilmadara7794 3 ปีที่แล้ว

    hello van, why after edit on terminal, i can't Esc

    • @VanTechCorner
      @VanTechCorner  3 ปีที่แล้ว

      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 3 ปีที่แล้ว

      @@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  3 ปีที่แล้ว

      Yes that's normal. Did you press :wq and Enter after that?

  • @o2cool321
    @o2cool321 4 ปีที่แล้ว

    Any idea on how to run a custom http header request using DD-WRT or openWRT?

    • @VanTechCorner
      @VanTechCorner  4 ปีที่แล้ว

      Hey, no idea for now I am looking for it. I'll let you know if there is anything new.

  • @泉奈宇智波-i1j
    @泉奈宇智波-i1j หลายเดือนก่อน

    Hi,Thx for the video but it doesn't work out for my Android 5G smart phone in China,still be limited in 30-40Mbps with usb tethering However,the WiFi hotspot speed is 180+mbps😂😂

  • @nguyenvanson__chdi1a913
    @nguyenvanson__chdi1a913 2 ปีที่แล้ว

    bác ơi mở giao diện ssh bằng cmd được không bác ?

    • @VanTechCorner
      @VanTechCorner  2 ปีที่แล้ว

      Đượ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 3 ปีที่แล้ว

    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.

  • @godzexist
    @godzexist 3 ปีที่แล้ว

    i believe there should be something wrong with the openwrt config

  • @xiv3r
    @xiv3r 4 หลายเดือนก่อน

    i want to ask something... did you tried this on the AP(Anti tethering) that has a TTL=1 and an outbound of TTL=65?
    Eg. AP TTL=1 -> Openwrt custom NAT firewall for TTL Outbound on WLAN0/ETH0 -> Outbound TTL=65

    • @VanTechCorner
      @VanTechCorner  4 หลายเดือนก่อน +1

      Hi, I haven't try that. Actually most of my connection is Fiber now, so I don't really care about setting TTL. If you have any finding, please share :)

    • @xiv3r
      @xiv3r 4 หลายเดือนก่อน

      @@VanTechCorner finally i got the solution to my question last week 😀
      #!/bin/sh /etc/rc.local
      iptables -F
      iptables -t mangle -F
      # Append the ttl before prerouting and postrouting (prerouting from ttl=1 into ttl=64) to bypass anti-tethering
      iptables -t mangle -A POSTROUTING -o wlan0 -j TTL --ttl-set 64
      iptables -t mangle -A PREROUTING -i wlan0 -j TTL --ttl-set 64
      # Redirect all traffic from wlan0 to br-lan and vice versa
      iptables -A FORWARD -i wlan0 -o br-lan -j ACCEPT
      iptables -A FORWARD -i br-lan -o wlan0 -j ACCEPT

    • @xiv3r
      @xiv3r 4 หลายเดือนก่อน

      @@VanTechCorner finally i got the solution to my question last week.
      # Flush existing table rules
      iptables -F
      iptables -t nat -F
      iptables -t mangle -F
      # Apply TTL 64 for outbound traffic (leaving interface wlan0)
      iptables -t mangle -A POSTROUTING -o wlan0 -j TTL --ttl-set 64
      # Apply TTL 64 for inbound traffic (entering interface wlan0) this will bypass anti-tethering AP
      iptables -t mangle -A PREROUTING -i wlan0 -j TTL --ttl-set 64
      # Allow forwarding of traffic from wlan0 to eth0
      iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
      # Allow returning traffic from eth0 to wlan0
      iptables -A FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
      # Optionally, if eth0 is connected to the internet, masquerade outbound traffic on eth0
      iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
      exit 0

    • @xiv3r
      @xiv3r 4 หลายเดือนก่อน

      @@VanTechCorner finally got the solution to my question last week 😁
      # Flush table rules
      iptables -F
      iptables -t nat -F
      iptables -t mangle -F
      # Apply TTL 64 for outbound traffic (leaving interface wlan0)
      iptables -t mangle -A POSTROUTING -o wlan0 -j TTL --ttl-set 64
      # Apply TTL 64 for inbound traffic (entering interface wlan0)
      iptables -t mangle -A PREROUTING -i wlan0 -j TTL --ttl-set 64
      # Allow forwarding of traffic from wlan0 to eth0
      iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
      # Allow returning traffic from eth0 to wlan0
      iptables -A FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
      # Optionally, if eth0 is connected to the internet, masquerade outbound traffic on eth0
      iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
      exit 0

  • @tonebaxter
    @tonebaxter 4 ปีที่แล้ว

    Can’t see...

    • @VanTechCorner
      @VanTechCorner  4 ปีที่แล้ว

      Hi, please try to watch it on your PC or turn on the CC feature in TH-cam and you can see the text in bigger size.

  • @rootmourad1133
    @rootmourad1133 4 ปีที่แล้ว

    How to watch IPTV channels on an openwrt system 🙄

    • @VanTechCorner
      @VanTechCorner  4 ปีที่แล้ว +1

      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 4 ปีที่แล้ว

      @@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  4 ปีที่แล้ว

      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 3 ปีที่แล้ว

    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  3 ปีที่แล้ว +1

      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