Port fowarding and load balancer in ubuntu server 12.04











up vote
4
down vote

favorite












I am looking to create a load balancing server. Essentially here is what I want to do:



I have a public IP address, lets say 1.1.1.1 I have a second public IP address, lets say 2.2.2.2. I have a website, www.f.com point to 1.1.1.1 via an A record. I want that Ubuntu server to forward traffic like this:




  • Port 80 traffic is forwarded to 2.2.2.2 on port 60,000 and port 60,001.

  • Port 443 traffic is forwaded to 2.2.2.2 on port 60,010 and port 60,011.

  • Port 25 traffic is forwared to 2.2.2.2 on port 60,020 and port 60,021


The port forwarding is more important then being able to load balance.



I look forward to some responses. Both server 1.1.1.1 and 2.2.2.2 are both running Ubuntu 12.04 server edition.










share|improve this question




















  • 1




    This seems more like a proxy setup and less of a load balancer...you can use iptables to do forwarding for you.
    – sparticvs
    Dec 3 '12 at 4:29












  • Is it necessary to keep into account whether the destination port is up? If not, iptables DNAT rules should be able to do it...
    – Gert van den Berg
    Dec 3 '12 at 6:27










  • using LVS would make more sense here than iptables
    – Rui F Ribeiro
    Nov 16 '15 at 7:40















up vote
4
down vote

favorite












I am looking to create a load balancing server. Essentially here is what I want to do:



I have a public IP address, lets say 1.1.1.1 I have a second public IP address, lets say 2.2.2.2. I have a website, www.f.com point to 1.1.1.1 via an A record. I want that Ubuntu server to forward traffic like this:




  • Port 80 traffic is forwarded to 2.2.2.2 on port 60,000 and port 60,001.

  • Port 443 traffic is forwaded to 2.2.2.2 on port 60,010 and port 60,011.

  • Port 25 traffic is forwared to 2.2.2.2 on port 60,020 and port 60,021


The port forwarding is more important then being able to load balance.



I look forward to some responses. Both server 1.1.1.1 and 2.2.2.2 are both running Ubuntu 12.04 server edition.










share|improve this question




















  • 1




    This seems more like a proxy setup and less of a load balancer...you can use iptables to do forwarding for you.
    – sparticvs
    Dec 3 '12 at 4:29












  • Is it necessary to keep into account whether the destination port is up? If not, iptables DNAT rules should be able to do it...
    – Gert van den Berg
    Dec 3 '12 at 6:27










  • using LVS would make more sense here than iptables
    – Rui F Ribeiro
    Nov 16 '15 at 7:40













up vote
4
down vote

favorite









up vote
4
down vote

favorite











I am looking to create a load balancing server. Essentially here is what I want to do:



I have a public IP address, lets say 1.1.1.1 I have a second public IP address, lets say 2.2.2.2. I have a website, www.f.com point to 1.1.1.1 via an A record. I want that Ubuntu server to forward traffic like this:




  • Port 80 traffic is forwarded to 2.2.2.2 on port 60,000 and port 60,001.

  • Port 443 traffic is forwaded to 2.2.2.2 on port 60,010 and port 60,011.

  • Port 25 traffic is forwared to 2.2.2.2 on port 60,020 and port 60,021


The port forwarding is more important then being able to load balance.



I look forward to some responses. Both server 1.1.1.1 and 2.2.2.2 are both running Ubuntu 12.04 server edition.










share|improve this question















I am looking to create a load balancing server. Essentially here is what I want to do:



I have a public IP address, lets say 1.1.1.1 I have a second public IP address, lets say 2.2.2.2. I have a website, www.f.com point to 1.1.1.1 via an A record. I want that Ubuntu server to forward traffic like this:




  • Port 80 traffic is forwarded to 2.2.2.2 on port 60,000 and port 60,001.

  • Port 443 traffic is forwaded to 2.2.2.2 on port 60,010 and port 60,011.

  • Port 25 traffic is forwared to 2.2.2.2 on port 60,020 and port 60,021


The port forwarding is more important then being able to load balance.



I look forward to some responses. Both server 1.1.1.1 and 2.2.2.2 are both running Ubuntu 12.04 server edition.







iptables port-forwarding load-balancing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 12 '13 at 17:59









Braiam

23k1975137




23k1975137










asked Dec 3 '12 at 2:32









Matthew St Nicholas Iverson

244




244








  • 1




    This seems more like a proxy setup and less of a load balancer...you can use iptables to do forwarding for you.
    – sparticvs
    Dec 3 '12 at 4:29












  • Is it necessary to keep into account whether the destination port is up? If not, iptables DNAT rules should be able to do it...
    – Gert van den Berg
    Dec 3 '12 at 6:27










  • using LVS would make more sense here than iptables
    – Rui F Ribeiro
    Nov 16 '15 at 7:40














  • 1




    This seems more like a proxy setup and less of a load balancer...you can use iptables to do forwarding for you.
    – sparticvs
    Dec 3 '12 at 4:29












  • Is it necessary to keep into account whether the destination port is up? If not, iptables DNAT rules should be able to do it...
    – Gert van den Berg
    Dec 3 '12 at 6:27










  • using LVS would make more sense here than iptables
    – Rui F Ribeiro
    Nov 16 '15 at 7:40








1




1




This seems more like a proxy setup and less of a load balancer...you can use iptables to do forwarding for you.
– sparticvs
Dec 3 '12 at 4:29






This seems more like a proxy setup and less of a load balancer...you can use iptables to do forwarding for you.
– sparticvs
Dec 3 '12 at 4:29














Is it necessary to keep into account whether the destination port is up? If not, iptables DNAT rules should be able to do it...
– Gert van den Berg
Dec 3 '12 at 6:27




Is it necessary to keep into account whether the destination port is up? If not, iptables DNAT rules should be able to do it...
– Gert van den Berg
Dec 3 '12 at 6:27












using LVS would make more sense here than iptables
– Rui F Ribeiro
Nov 16 '15 at 7:40




using LVS would make more sense here than iptables
– Rui F Ribeiro
Nov 16 '15 at 7:40










3 Answers
3






active

oldest

votes

















up vote
0
down vote













I would recommend Pound (http://www.apsis.ch/pound). It's lightweight, easy to configure, handles https quick and efficient, and does exactly what you want.






share|improve this answer




























    up vote
    0
    down vote













    If you are looking to load balance data. I might recomend you to use varnish. It is easy to install and set and easy to add nodes later






    share|improve this answer




























      up vote
      0
      down vote













      If you want to serve HTTP or raw TCP traffic, HAProxy might be a good option to you. It satisfies all the conditions you provided above.



      References:




      • http://www.haproxy.org/






      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',
        autoActivateHeartbeat: false,
        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%2f57419%2fport-fowarding-and-load-balancer-in-ubuntu-server-12-04%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        0
        down vote













        I would recommend Pound (http://www.apsis.ch/pound). It's lightweight, easy to configure, handles https quick and efficient, and does exactly what you want.






        share|improve this answer

























          up vote
          0
          down vote













          I would recommend Pound (http://www.apsis.ch/pound). It's lightweight, easy to configure, handles https quick and efficient, and does exactly what you want.






          share|improve this answer























            up vote
            0
            down vote










            up vote
            0
            down vote









            I would recommend Pound (http://www.apsis.ch/pound). It's lightweight, easy to configure, handles https quick and efficient, and does exactly what you want.






            share|improve this answer












            I would recommend Pound (http://www.apsis.ch/pound). It's lightweight, easy to configure, handles https quick and efficient, and does exactly what you want.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 3 '12 at 19:25









            Doka

            614




            614
























                up vote
                0
                down vote













                If you are looking to load balance data. I might recomend you to use varnish. It is easy to install and set and easy to add nodes later






                share|improve this answer

























                  up vote
                  0
                  down vote













                  If you are looking to load balance data. I might recomend you to use varnish. It is easy to install and set and easy to add nodes later






                  share|improve this answer























                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    If you are looking to load balance data. I might recomend you to use varnish. It is easy to install and set and easy to add nodes later






                    share|improve this answer












                    If you are looking to load balance data. I might recomend you to use varnish. It is easy to install and set and easy to add nodes later







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jul 15 '15 at 21:15









                    dSoultanis

                    1212




                    1212






















                        up vote
                        0
                        down vote













                        If you want to serve HTTP or raw TCP traffic, HAProxy might be a good option to you. It satisfies all the conditions you provided above.



                        References:




                        • http://www.haproxy.org/






                        share|improve this answer

























                          up vote
                          0
                          down vote













                          If you want to serve HTTP or raw TCP traffic, HAProxy might be a good option to you. It satisfies all the conditions you provided above.



                          References:




                          • http://www.haproxy.org/






                          share|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            If you want to serve HTTP or raw TCP traffic, HAProxy might be a good option to you. It satisfies all the conditions you provided above.



                            References:




                            • http://www.haproxy.org/






                            share|improve this answer












                            If you want to serve HTTP or raw TCP traffic, HAProxy might be a good option to you. It satisfies all the conditions you provided above.



                            References:




                            • http://www.haproxy.org/







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jan 1 at 11:26









                            xulsitatirev

                            50917




                            50917






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f57419%2fport-fowarding-and-load-balancer-in-ubuntu-server-12-04%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