iptables limit the number of connections in the system for both ipv4 ipv6











up vote
1
down vote

favorite












A connection is a 5 tuple (ip src/dst, port src/dst, protocol).

What about different connections between ipv4 and ipv6?



If I define the iptables rule:



iptables -A INPUT -p tcp -m connlimit --connlimit-above 50 -j REJECT --reject-with tcp-reset


It limits the tcp connections to 50.



What about ipv6 tcp connections? should I write also



ip6tables -A INPUT -p tcp -m connlimit --connlimit-above 50 -j REJECT --reject-with tcp-reset


?



Does it mean that I can have 100 tcp connections overall? (50 ipv4 50 ipv6) ?



How does it work?
Thanks.










share|improve this question


























    up vote
    1
    down vote

    favorite












    A connection is a 5 tuple (ip src/dst, port src/dst, protocol).

    What about different connections between ipv4 and ipv6?



    If I define the iptables rule:



    iptables -A INPUT -p tcp -m connlimit --connlimit-above 50 -j REJECT --reject-with tcp-reset


    It limits the tcp connections to 50.



    What about ipv6 tcp connections? should I write also



    ip6tables -A INPUT -p tcp -m connlimit --connlimit-above 50 -j REJECT --reject-with tcp-reset


    ?



    Does it mean that I can have 100 tcp connections overall? (50 ipv4 50 ipv6) ?



    How does it work?
    Thanks.










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      A connection is a 5 tuple (ip src/dst, port src/dst, protocol).

      What about different connections between ipv4 and ipv6?



      If I define the iptables rule:



      iptables -A INPUT -p tcp -m connlimit --connlimit-above 50 -j REJECT --reject-with tcp-reset


      It limits the tcp connections to 50.



      What about ipv6 tcp connections? should I write also



      ip6tables -A INPUT -p tcp -m connlimit --connlimit-above 50 -j REJECT --reject-with tcp-reset


      ?



      Does it mean that I can have 100 tcp connections overall? (50 ipv4 50 ipv6) ?



      How does it work?
      Thanks.










      share|improve this question













      A connection is a 5 tuple (ip src/dst, port src/dst, protocol).

      What about different connections between ipv4 and ipv6?



      If I define the iptables rule:



      iptables -A INPUT -p tcp -m connlimit --connlimit-above 50 -j REJECT --reject-with tcp-reset


      It limits the tcp connections to 50.



      What about ipv6 tcp connections? should I write also



      ip6tables -A INPUT -p tcp -m connlimit --connlimit-above 50 -j REJECT --reject-with tcp-reset


      ?



      Does it mean that I can have 100 tcp connections overall? (50 ipv4 50 ipv6) ?



      How does it work?
      Thanks.







      networking iptables ipv6 ipv4






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 19 '17 at 12:07









      hudac

      332312




      332312






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          You will have 50 of each connections, since iptables will handle only ipv4 and ip6tables will deal with ipv6 connections. They will not "sum" up, because they are managed by different tools on each protocol version.



          Will nftables, the "new firewall" be able to deal with both protocols summing up everything? No. You will have the "same tool"(nft binary) to deal with protocols independently using the rule keyword: nft add rule ip6 ... and nft add rule ip ...



          As pointed out in the comments, the nft_connlimit extension was recently added to Linux 4.18, allowing you to count sum ipv4 and ipv6 if you use the reserved word inet while creating rules.



          Related Stuff:




          • Serverfault: How do you set a max connection limit with nftables?






          share|improve this answer



















          • 1




            Now the feature has been implemented with nftables, actually using the family inet instead of just ip or just ip6 will use the combined count of IPv4 and IPv6 connections retrieved from conntrack. See my related answer on SF there: How do you set a max connection limit with nftables?
            – A.B
            Nov 13 at 23:59












          • Thanks for the info A.B. Added to the answer :)
            – nwildner
            Nov 14 at 9:59


















          up vote
          1
          down vote













          Yes, that means you can have 50+50 connections.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f338611%2fiptables-limit-the-number-of-connections-in-the-system-for-both-ipv4-ipv6%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            You will have 50 of each connections, since iptables will handle only ipv4 and ip6tables will deal with ipv6 connections. They will not "sum" up, because they are managed by different tools on each protocol version.



            Will nftables, the "new firewall" be able to deal with both protocols summing up everything? No. You will have the "same tool"(nft binary) to deal with protocols independently using the rule keyword: nft add rule ip6 ... and nft add rule ip ...



            As pointed out in the comments, the nft_connlimit extension was recently added to Linux 4.18, allowing you to count sum ipv4 and ipv6 if you use the reserved word inet while creating rules.



            Related Stuff:




            • Serverfault: How do you set a max connection limit with nftables?






            share|improve this answer



















            • 1




              Now the feature has been implemented with nftables, actually using the family inet instead of just ip or just ip6 will use the combined count of IPv4 and IPv6 connections retrieved from conntrack. See my related answer on SF there: How do you set a max connection limit with nftables?
              – A.B
              Nov 13 at 23:59












            • Thanks for the info A.B. Added to the answer :)
              – nwildner
              Nov 14 at 9:59















            up vote
            3
            down vote



            accepted










            You will have 50 of each connections, since iptables will handle only ipv4 and ip6tables will deal with ipv6 connections. They will not "sum" up, because they are managed by different tools on each protocol version.



            Will nftables, the "new firewall" be able to deal with both protocols summing up everything? No. You will have the "same tool"(nft binary) to deal with protocols independently using the rule keyword: nft add rule ip6 ... and nft add rule ip ...



            As pointed out in the comments, the nft_connlimit extension was recently added to Linux 4.18, allowing you to count sum ipv4 and ipv6 if you use the reserved word inet while creating rules.



            Related Stuff:




            • Serverfault: How do you set a max connection limit with nftables?






            share|improve this answer



















            • 1




              Now the feature has been implemented with nftables, actually using the family inet instead of just ip or just ip6 will use the combined count of IPv4 and IPv6 connections retrieved from conntrack. See my related answer on SF there: How do you set a max connection limit with nftables?
              – A.B
              Nov 13 at 23:59












            • Thanks for the info A.B. Added to the answer :)
              – nwildner
              Nov 14 at 9:59













            up vote
            3
            down vote



            accepted







            up vote
            3
            down vote



            accepted






            You will have 50 of each connections, since iptables will handle only ipv4 and ip6tables will deal with ipv6 connections. They will not "sum" up, because they are managed by different tools on each protocol version.



            Will nftables, the "new firewall" be able to deal with both protocols summing up everything? No. You will have the "same tool"(nft binary) to deal with protocols independently using the rule keyword: nft add rule ip6 ... and nft add rule ip ...



            As pointed out in the comments, the nft_connlimit extension was recently added to Linux 4.18, allowing you to count sum ipv4 and ipv6 if you use the reserved word inet while creating rules.



            Related Stuff:




            • Serverfault: How do you set a max connection limit with nftables?






            share|improve this answer














            You will have 50 of each connections, since iptables will handle only ipv4 and ip6tables will deal with ipv6 connections. They will not "sum" up, because they are managed by different tools on each protocol version.



            Will nftables, the "new firewall" be able to deal with both protocols summing up everything? No. You will have the "same tool"(nft binary) to deal with protocols independently using the rule keyword: nft add rule ip6 ... and nft add rule ip ...



            As pointed out in the comments, the nft_connlimit extension was recently added to Linux 4.18, allowing you to count sum ipv4 and ipv6 if you use the reserved word inet while creating rules.



            Related Stuff:




            • Serverfault: How do you set a max connection limit with nftables?







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 14 at 9:58

























            answered Jan 19 '17 at 12:18









            nwildner

            13.7k14075




            13.7k14075








            • 1




              Now the feature has been implemented with nftables, actually using the family inet instead of just ip or just ip6 will use the combined count of IPv4 and IPv6 connections retrieved from conntrack. See my related answer on SF there: How do you set a max connection limit with nftables?
              – A.B
              Nov 13 at 23:59












            • Thanks for the info A.B. Added to the answer :)
              – nwildner
              Nov 14 at 9:59














            • 1




              Now the feature has been implemented with nftables, actually using the family inet instead of just ip or just ip6 will use the combined count of IPv4 and IPv6 connections retrieved from conntrack. See my related answer on SF there: How do you set a max connection limit with nftables?
              – A.B
              Nov 13 at 23:59












            • Thanks for the info A.B. Added to the answer :)
              – nwildner
              Nov 14 at 9:59








            1




            1




            Now the feature has been implemented with nftables, actually using the family inet instead of just ip or just ip6 will use the combined count of IPv4 and IPv6 connections retrieved from conntrack. See my related answer on SF there: How do you set a max connection limit with nftables?
            – A.B
            Nov 13 at 23:59






            Now the feature has been implemented with nftables, actually using the family inet instead of just ip or just ip6 will use the combined count of IPv4 and IPv6 connections retrieved from conntrack. See my related answer on SF there: How do you set a max connection limit with nftables?
            – A.B
            Nov 13 at 23:59














            Thanks for the info A.B. Added to the answer :)
            – nwildner
            Nov 14 at 9:59




            Thanks for the info A.B. Added to the answer :)
            – nwildner
            Nov 14 at 9:59












            up vote
            1
            down vote













            Yes, that means you can have 50+50 connections.






            share|improve this answer

























              up vote
              1
              down vote













              Yes, that means you can have 50+50 connections.






              share|improve this answer























                up vote
                1
                down vote










                up vote
                1
                down vote









                Yes, that means you can have 50+50 connections.






                share|improve this answer












                Yes, that means you can have 50+50 connections.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 19 '17 at 12:16









                Henrik

                3,4851419




                3,4851419






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f338611%2fiptables-limit-the-number-of-connections-in-the-system-for-both-ipv4-ipv6%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Morgemoulin

                    Scott Moir

                    Souastre