Friday, March 19, 2010

Setting Load Balancing dengan Fail Over.

Setting Load Balancing dengan Fail Over.

Load Balancing ini sudah saya terapkan di Mikrotik 2.9.6 dan bisa diaplikasi ke versi yang lebih tinggi dan hasilnya dapat bekerja dengan baik.

Berikut ini Scriptnya :

/ip route add gateway=12.20.20.254 distance=1 comment="utama"
/ip route add gateway=11.20.20.254 distance=2 comment="cadangan"
/ip route add destination=203.208.151.185/32 gateway=12.20.20.254
/system script add name="autogw" source={
:if ([/ip route get [/ip route find comment="utama"] disabled]="yes") do={/ip route enable [/ip route find comment="utama"]} else={/ip route disable [/ip route find comment="utama"]}
}
/system script add name="utama-return" source={
:if ([/ip route get [/ip route find comment="utama"] disabled]="yes") do={/ip route enable [/ip route find comment="utama"]}
}
/tool netwatch add host=203.208.151.185 interval=15s timeout=2s down-script="autogw"
/tool netwatch add host=203.208.151.185 interval=15s timeout=2s up-script="utama-return"

Template by : kendhin x-template.blogspot.com