how to use regular expression with iptables

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I am trying to do a routing rule to a bunch a subdomains matched by regular expression.



iptables -t nat -A PREROUTING -m string --string "/must-[a-z0-9-.]+gonow[a-z.]+/g" --algo regex -p tcp -m tcp --dport 12 -j DNAT --to-destination 1.1.1.1:12


getting error - iptables: No chain/target/match by that name.










share|improve this question

























    up vote
    0
    down vote

    favorite












    I am trying to do a routing rule to a bunch a subdomains matched by regular expression.



    iptables -t nat -A PREROUTING -m string --string "/must-[a-z0-9-.]+gonow[a-z.]+/g" --algo regex -p tcp -m tcp --dport 12 -j DNAT --to-destination 1.1.1.1:12


    getting error - iptables: No chain/target/match by that name.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to do a routing rule to a bunch a subdomains matched by regular expression.



      iptables -t nat -A PREROUTING -m string --string "/must-[a-z0-9-.]+gonow[a-z.]+/g" --algo regex -p tcp -m tcp --dport 12 -j DNAT --to-destination 1.1.1.1:12


      getting error - iptables: No chain/target/match by that name.










      share|improve this question













      I am trying to do a routing rule to a bunch a subdomains matched by regular expression.



      iptables -t nat -A PREROUTING -m string --string "/must-[a-z0-9-.]+gonow[a-z.]+/g" --algo regex -p tcp -m tcp --dport 12 -j DNAT --to-destination 1.1.1.1:12


      getting error - iptables: No chain/target/match by that name.







      networking iptables regex






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 31 at 20:33









      Vitalik Jimbei

      1151312




      1151312




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          The problem is that you are attempting to use a relatively slow pattern matching algorithm in an application that MUST use a fast pattern matching algorithm. Also know that the entire use of the "string" filter can be compute intensive, and for that reason just a few years ago that module was not available by default. You will have to learn either the Boyer-Moore (bm) or Knuth-Pratt-Morris (kmp) fast string matching algorithms and use one of those.



          See also the manual pages for iptables-extensions. Excerpt:



           --algo bm
          Select the pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris)





          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1001847%2fhow-to-use-regular-expression-with-iptables%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            The problem is that you are attempting to use a relatively slow pattern matching algorithm in an application that MUST use a fast pattern matching algorithm. Also know that the entire use of the "string" filter can be compute intensive, and for that reason just a few years ago that module was not available by default. You will have to learn either the Boyer-Moore (bm) or Knuth-Pratt-Morris (kmp) fast string matching algorithms and use one of those.



            See also the manual pages for iptables-extensions. Excerpt:



             --algo bm
            Select the pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris)





            share|improve this answer
























              up vote
              0
              down vote













              The problem is that you are attempting to use a relatively slow pattern matching algorithm in an application that MUST use a fast pattern matching algorithm. Also know that the entire use of the "string" filter can be compute intensive, and for that reason just a few years ago that module was not available by default. You will have to learn either the Boyer-Moore (bm) or Knuth-Pratt-Morris (kmp) fast string matching algorithms and use one of those.



              See also the manual pages for iptables-extensions. Excerpt:



               --algo bm
              Select the pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris)





              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                The problem is that you are attempting to use a relatively slow pattern matching algorithm in an application that MUST use a fast pattern matching algorithm. Also know that the entire use of the "string" filter can be compute intensive, and for that reason just a few years ago that module was not available by default. You will have to learn either the Boyer-Moore (bm) or Knuth-Pratt-Morris (kmp) fast string matching algorithms and use one of those.



                See also the manual pages for iptables-extensions. Excerpt:



                 --algo bm
                Select the pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris)





                share|improve this answer












                The problem is that you are attempting to use a relatively slow pattern matching algorithm in an application that MUST use a fast pattern matching algorithm. Also know that the entire use of the "string" filter can be compute intensive, and for that reason just a few years ago that module was not available by default. You will have to learn either the Boyer-Moore (bm) or Knuth-Pratt-Morris (kmp) fast string matching algorithms and use one of those.



                See also the manual pages for iptables-extensions. Excerpt:



                 --algo bm
                Select the pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 31 at 21:46









                Doug Smythies

                6,34631426




                6,34631426



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1001847%2fhow-to-use-regular-expression-with-iptables%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    pylint3 and pip3 broken

                    Missing snmpget and snmpwalk

                    How to enroll fingerprints to Ubuntu 17.10 with VFS491