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

    Filtering based on TTL or Packet Length

    Scheduled Pinned Locked Moved Firewalling
    5 Posts 3 Posters 244 Views 3 Watching
    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.
    • N Offline
      Nanj0
      last edited by

      Hi,

      This is probably an unusual case, but I need drop UDP packets based on TTL or packet length. I found this post: https://forum.netgate.com/topic/51318/packet-size-filtering
      Showing it is possible using IPFW. Does anyone have any example commands for ipfw for something like this? The ipfw syntax is rather daunting to me, I have something like: ipfw -q add drop udp from any to any iplen 100

      Just looking to see if anyone has any experience with ipfw who can throw a couple of good example lines.

      Thanks.

      1 Reply Last reply Reply Quote 0
      • NogBadTheBadN Offline
        NogBadTheBad
        last edited by

        You could do it with snort and a custom ttl rule.

        http://manual-snort-org.s3-website-us-east-1.amazonaws.com/node33.html

        Andy

        1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

        1 Reply Last reply Reply Quote 0
        • viktor_gV Offline
          viktor_g Netgate
          last edited by

          see https://forum.netgate.com/topic/155187/how-to-block-mobile-teethering-in-pfsense

          1 Reply Last reply Reply Quote 0
          • NogBadTheBadN Offline
            NogBadTheBad
            last edited by NogBadTheBad

            alert ip 172.16.5.0/24 any -> !$HOME_NET any (msg: "IP with TTL>=100"; ttl:100-255; sid:20000012; rev:001;classtype: policy-violation;)

            Where 172.16.5.0/24 is the local subnet, if you have it set to any it will block multicast packets.

            Screenshot 2020-07-14 at 18.33.08.png

            A ping to google.com with a ttl of 100:-
            ping -m100 8.8.8.8

            Andy

            1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

            1 Reply Last reply Reply Quote 0
            • NogBadTheBadN Offline
              NogBadTheBad
              last edited by

              Just alert on the first packet in 300 seconds:-

              alert ip 172.16.5.0/24 any -> !$HOME_NET any (msg: "IP with TTL>=100"; ttl:100-255; threshold:type limit, track by_dst, count 1 , seconds 300; sid:20000012; rev:001;classtype: policy-violation;)

              Andy

              1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.