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

    ICMP Codes

    Scheduled Pinned Locked Moved Firewalling
    9 Posts 3 Posters 3.0k 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.
    • G
      gridrun
      last edited by

      Hi,

      Is there a way to set ICMP codes in firewall rules? Like, filtering just Dest. Unreachable (Fragmentation Needed) for example?

      Tech stuff on my blog: http://niston.wordpress.com

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        If you set a rule's protocol to ICMP you get a drop-down to select the ICMP type that the rule will match.

        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!

        1 Reply Last reply Reply Quote 0
        • G
          gridrun
          last edited by

          @gridrun:

          Hi,

          Is there a way to set ICMP codes in firewall rules? Like, filtering just Dest. Unreachable (Fragmentation Needed) for example?

          Types != Codes :)

          Tech stuff on my blog: http://niston.wordpress.com

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            In that case, no, not in our GUI. pf can do it we just don't have a way to enter them in the GUI.

            (Most people confuse the codes/types โ€“ safer to assume people meant types)

            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!

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator
              last edited by

              So you want specific to be really specific, say type 3 (dest unreach) code 2 protocol unreach while code 3 would mean port unreachable, 4 frag needed but dont frag set sort of codes.

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              1 Reply Last reply Reply Quote 0
              • jimpJ
                jimp Rebel Alliance Developer Netgate
                last edited by

                That sounds nice in theory but IIRC in reality if those packets are actually part of a connection pf would allow them, they wouldn't be considered "new" for evaluation by firewall rules, they'd be part of the connection state. (could be misremembering that, worth double checking, but I lack the time to do so at the moment)

                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!

                1 Reply Last reply Reply Quote 0
                • G
                  gridrun
                  last edited by

                  @johnpoz:

                  So you want specific to be really specific, say type 3 (dest unreach) code 2 protocol unreach while code 3 would mean port unreachable, 4 frag needed but dont frag set sort of codes.

                  yep. I envision a nice drop down style selector for the code as well, including "any". I reckon the GUI would be sorta complex because code meanings vary with types. But it would allow for finer control over ICMP traffic and complete icmp filtering functionality. Of course it can't be added if the underlying packet filter doesn't support filtering by type&code.

                  Tech stuff on my blog: http://niston.wordpress.com

                  1 Reply Last reply Reply Quote 0
                  • jimpJ
                    jimp Rebel Alliance Developer Netgate
                    last edited by

                    patches accepted :-)

                    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!

                    1 Reply Last reply Reply Quote 0
                    • G
                      gridrun
                      last edited by

                      @jimp:

                      patches accepted :-)

                      coolio! :-D

                      Tech stuff on my blog: http://niston.wordpress.com

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