TechSpot

1 Webserver, 2 ISP static IPs, load balancing.. how to do it?

By HungryMind
Oct 30, 2011
Post New Reply
  1. Hi Guys,

    Got very good inputs from the forum on setting up my network..and its working fine now.

    Got one more issue where I need inputs from experts for the best way to do it.

    I have got a webserver running behind a router. Now I am planning to add redundancy by taking another static IP from other ISP.

    And I wish to balance my incoming load between two connections.

    What would be the best way to reach this goal with minimum cosyt involved and best security.

    Do I add multiple NIC card on the websers, would that help

    Or is it possible to connect two router to same switch.

    or would HA proxy be of any help n addition to something above.

    Any pointers to a good site or tutorial would also be gr8

    BR,
    hungrymind
  2. jobeard

    jobeard TS Ambassador Posts: 13,403   +314

    yes, this can work with (2x) nic's in the webserver
    Code:
    isp#1=== webserver === isp#2
    
    However,
    is not trivial.
    As shown, the first connection (let's assume it's #1) will get the default route in your
    routing table (that's in the webserver, not a router or switch). The default route is important & solves the question
    • where do I send the data when I don't know the IP address?
    It's the DNS that does this and it will be routed to the default gateway
    (see route print).

    Adding a router +- a switch or two do not solve the problem.

    The presence of isp#2 will only add a specific route for that ISPs gateway.
    given
    1. If isp#1 gateway is at 172.16.132.1
    2. isp#2 gateway is at 10.1.2.1
    3. your webserver is at 192.168.1.4
    then the routing table might well look like
    Code:
    Network Destination        Netmask          Gateway       Interface  Metric
              0.0.0.0          0.0.0.0      192.168.0.1     [COLOR="Blue"]192.168.1.4[/COLOR]       20
            127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
          [COLOR="Blue"]192.168.0.0[/COLOR]    255.255.255.0      192.168.0.4     [COLOR="Blue"]192.168.1.4[/COLOR]       20    
          [COLOR="Red"]10.1.2.0[/COLOR]    255.255.255.0      [COLOR="Red"]10.1.2.2[/COLOR]    [COLOR="Red"]10.1.2.2[/COLOR]      20
          192.168.0.4  255.255.255.255        127.0.0.1       127.0.0.1       20
        192.168.0.255  255.255.255.255      192.168.0.4     192.168.0.4       20
            224.0.0.0        240.0.0.0      192.168.0.4     192.168.0.4       20
      255.255.255.255  255.255.255.255      192.168.0.4     192.168.0.4       1
    Default Gateway:       192.168.0.1
    the 0.0.0.0 ->192.168.0.1 is the default for all unknown traffic
    the 192.168.0.0 -> 192.168.0.4 would be all local traffic on that nic
    and 10.1.2.0 -> 10.1.2.2 would be local traffic for the 10.1.2.* nic.

    THERE IS NO WAY to round-robin requestes between the
    192.168.0.* connection and the 10.1.2.* connection

    Load Balancing is frequently done by
    • registring a domain name
    • adding two more more DNS servers for that domain
    • and then choosing a round-robin scheduling technique to provide a different one to every dns request.
    Using google.com as an example, there are FOUR dns servers
    Domain servers in listed order:
    • ns1.google.com ==> 216.239.32.10
    • ns2.google.com ==> 216.239.34.10
    • ns3.google.com ==> 216.239.36.10
    • ns4.google.com ==> 216.239.38.10


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.