Find the answer to your Linux question:
Results 1 to 3 of 3
i used the following script to make load balancing on the 2 internet NIC's eth0,eth2 ..while iam getting requests from the LAN on eth1 part of the script: ------------------------------------------------------------------------------------------------------------ eth0ip=192.168.0.84 ...
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    2

    how to make load balancing??

    i used the following script to make load balancing on the 2 internet NIC's eth0,eth2
    ..while iam getting requests from the LAN on eth1

    part of the script:
    ------------------------------------------------------------------------------------------------------------
    eth0ip=192.168.0.84 # inside
    eth1ip=10.0.0.1 # LAN IP
    eth2ip=82.201.210.166
    subnet=10.0.0.0/24
    subeth0=192.168.0.0/24
    subeth2=82.201.210.160/29
    provider0=192.168.0.3
    provider2=82.201.210.161
    DNS1=192.168.0.5
    #-----------------------------LOAD BALANCING---------------------------------

    ip route flush table t1 all
    ip route flush table t2 all
    ip route flush cache
    #*****************
    ip route add $subeth0 dev eth0 src $eth0ip table t1
    ip route add $subeth2 dev eth2 src $eth2ip table t2
    #*****************
    ip route add default via $provider0 table t1
    ip route add default via $provider2 table t2
    #*****************
    ip rule add from $eth0ip table t1
    ip rule add from $eth2ip table t2
    #*****************
    ip route add $subnet dev eth1 table t1
    ip route add 127.0.0.0/8 dev lo table t1
    ip route add $subnet dev eth2 table t2
    ip route add 127.0.0.0/8 dev lo table t2
    #*****************
    ip route add default scope global nexthop via $provider2 dev eth2 weight 1 nexthop via $provider0 dev eth0 weight 1
    #-----------------------------------------------------------------------------------------------------------

    but after using tcdump to c the result..eth2 always has traffic more than eth0

    can any 1 help in that plz??

  2. #2
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    wouldn't it be easier to use something made for load balancing
    The Linux Virtual Server Project - Linux Server Cluster for Load Balancing

    I use ipvsadm for my loadbalancing and use ldirectord to control it, and I use heartbeat for my failover, because load balancing without failover is still a single point of failure

    here is some more good documentation
    Ultra Monkey: Configuration:

    on the first site I linked, there is lots of documentation.

  3. #3
    Just Joined!
    Join Date
    Jun 2008
    Posts
    2
    thx but i have to make the configuration manually..it is kind of project

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •