• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

How to set TTL?

Scheduled Pinned Locked Moved General pfSense Questions
10 Posts 5 Posters 6.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    Mascot
    last edited by Sep 18, 2018, 2:55 PM

    I need to set same TTL for all outbound packets of my LAN.

    I could not find where exactly this setting is in pfSense webGUI?

    It can be easily done in OpenWrt or RouterOS, but how to do it in pfSense?

    Please, help.

    1 Reply Last reply Reply Quote 0
    • M
      Mascot
      last edited by Sep 19, 2018, 1:39 PM

      Maybe I wasn't clear enough.

      Here is what I need: if one of my LAN devices sends IP packets with, say, TTL=63, and another one with TTL=128, then when going through pfSense to WAN they all must have TTL=X (where "X" is whatever value I would set in pfSense).

      How do I set this up in pfSense? Do I need to create some filtering rule or... ?

      1 Reply Last reply Reply Quote 0
      • J
        JKnott
        last edited by Sep 19, 2018, 5:29 PM

        TTL is determined by the originating OS and only decremented by routers. I'd suspect changing TTL or hop limit on IPv6 might be a security risk. On IPv6, a hop limit of 255 is used to ensure a packet did not originate off the local LAN. Also, if routers could set TTL, then it would be possible to create a loop that defeats the TTL and results in packets travelling in that loop forever.

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

        1 Reply Last reply Reply Quote 0
        • J
          jimp Rebel Alliance Developer Netgate
          last edited by Sep 19, 2018, 6:39 PM

          Altering the TTL is a great way to cause routing loops.

          pf does not have a way to set the TTL on packets.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          A 1 Reply Last reply Sep 19, 2018, 8:47 PM Reply Quote 0
          • A
            AndrewZ @jimp
            last edited by Sep 19, 2018, 8:47 PM

            @jimp said in How to set TTL?:

            Altering the TTL is a great way to cause routing loops.

            This is also a common way to hide the phone/modem tethering from the wireless carrier. I guess that is what is driving the OP.

            J 1 Reply Last reply Sep 19, 2018, 9:04 PM Reply Quote 1
            • J
              JKnott @AndrewZ
              last edited by Sep 19, 2018, 9:04 PM

              @andrewz said in How to set TTL?:

              This is also a common way to hide the phone/modem tethering from the wireless carrier. I guess that is what is driving the OP.

              Do they still do that?

              PfSense running on Qotom mini PC
              i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
              UniFi AC-Lite access point

              I haven't lost my mind. It's around here...somewhere...

              A 1 Reply Last reply Sep 19, 2018, 9:14 PM Reply Quote 0
              • A
                AndrewZ @JKnott
                last edited by Sep 19, 2018, 9:14 PM

                @jknott
                yup, common techniques to prevent ToS violations are TTL checking and IMEI lookup. Some carriers are also implementing some sort of behavioral analysis, i.e. Android phone should not be talking with Windows Update web site.

                1 Reply Last reply Reply Quote 0
                • ?
                  A Former User
                  last edited by A Former User Sep 19, 2018, 9:37 PM Sep 19, 2018, 9:34 PM

                  With pf scrub you can have a "minimum TTL" and all packets can be rewritten to make sure they meet this minimum TTL.

                  Maybe not quite what you're after? Certainly there's no GUI for this, you'd be out on your own.

                  Manual.

                  M 1 Reply Last reply Sep 20, 2018, 3:21 PM Reply Quote 0
                  • M
                    Mascot @A Former User
                    last edited by Sep 20, 2018, 3:21 PM

                    @muppet said in How to set TTL?:

                    With pf scrub you can have a "minimum TTL" and all packets can be rewritten to make sure they meet this minimum TTL.

                    Maybe not quite what you're after? Certainly there's no GUI for this, you'd be out on your own.

                    Manual.

                    As far as I understood, scrub min-ttl enforces a minimum TTL. I.e. if I would set TTL on pfSense to be, say, 64 and some of my LAN devices would send packets with TTL=128, then pfSense won't change this one down to 64? Right?

                    In this case my only option to have same TTL with "pf scrub" is to set it to maximum value of 255? (Side question: are there any downsides of having TTL=255?)

                    Also, shouldn't there be possible some workaround to avoid looping? Like router somehow recognizing and ignoring packets if they are in a loop?

                    Also, maybe for FreeBSD there is something like "iptables mangle" for Linux?

                    1 Reply Last reply Reply Quote 0
                    • J
                      JKnott
                      last edited by Sep 20, 2018, 3:34 PM

                      @mascot said in How to set TTL?:

                      In this case my only option to have same TTL with "pf scrub" is to set it to maximum value of 255? (Side question: are there any downsides of having TTL=255?)
                      Also, shouldn't there be possible some workaround to avoid looping? Like router somehow recognizing and ignoring packets if they are in a loop?
                      Also, maybe for FreeBSD there is something like "iptables mangle" for Linux?

                      Well, as I mentioned, on IPv6 255 indicates a packet that's intended for the local LAN only. Will a router pass it? Also, recognizing packets it's seen before, that would require saving the packets it already sent and then comparing them with any new packets. That might keep a router a bit busy. Also, if a router sees a packet with 255, the assumption can only be that the previous router decremented from 0 and sent it on, violating the rule that says packets with or decremented to 0 must be discarded. You're trying to defeat the entire purpose of MTU, which is to prevent a packet from being sent forever around a loop.

                      PfSense running on Qotom mini PC
                      i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                      UniFi AC-Lite access point

                      I haven't lost my mind. It's around here...somewhere...

                      1 Reply Last reply Reply Quote 0
                      • G Gertjan referenced this topic on Mar 5, 2025, 9:08 AM
                      7 out of 10
                      • First post
                        7/10
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                        This community forum collects and processes your personal information.
                        consent.not_received