Quantcast
Channel: Swandhana Project » Linux
Viewing all articles
Browse latest Browse all 10

load_balancing@slackware

$
0
0

berikut scrip load balancing di slackware, namun sebelum menjalankan scrip ini perlu di inget untuk costumize kernel dengan patch dari sini

#$IF1 be the name of the first interface
#$IF2 the name of the second interface.
#$IP1 be the IP address associated with $IF1
#$IP2 the IP address associated with $IF2.
#$P1 be the IP address of the gateway at Provider 1,
#$P2 the IP address of the gateway at provider 2.
#$P1_NET be the IP network $P1 is in,
#$P2_NET the IP network $P2 is in.

IF1="eth0"
IP1="192.168.1.3"
P1="192.168.1.1"
P1_NET="192.168.1.0/24"

IF2="eth2"
IP2="192.168.30.2"
P2="192.168.30.1"
P2_NET="192.168.30.0/24"

ip route add $P1_NET dev $IF1 src $IP1 table T1
ip route add default via $P1 table T1
ip route add $P1_NET dev $IF1 src $IP1

ip route add $P2_NET dev $IF2 src $IP2 table T2
ip route add default via $P2 table T2
ip route add $P2_NET dev $IF2 src $IP2

ip route add default via $P1

ip rule add from $IP1 table T1
ip rule add from $IP2 table T2

ip route add 192.168.10.0/27 dev eth1 table T2
ip route add $P1_NET     dev $IF1 table T2
ip route add 127.0.0.0/8 dev lo   table T2

ip route add 192.168.10.0/27 dev eth1 table T1
ip route add $P2_NET     dev $IF2 table T1
ip route add 127.0.0.0/8 dev lo   table T1

ip route add default scope global nexthop via $P1 dev $IF1 weight 1 nexthop via $P2 dev $IF2 weight 1


Viewing all articles
Browse latest Browse all 10

Trending Articles