Port fowarding and load balancer in ubuntu server 12.04

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











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

22.6k1971132




22.6k1971132










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',
        convertImagesToLinks: false,
        noModals: false,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        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%2funix.stackexchange.com%2fquestions%2f57419%2fport-fowarding-and-load-balancer-in-ubuntu-server-12-04%23new-answer', 'question_page');

        );

        Post as a guest






























        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









                            Kamil Zabielski

                            5097




                            5097



























                                 

                                draft saved


                                draft discarded















































                                 


                                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













































































                                Popular posts from this blog

                                How to check contact read email or not when send email to Individual?

                                Bahrain

                                Postfix configuration issue with fips on centos 7; mailgun relay