Setting Load Balancing PCC 2 ISP + Fail Over Menggunakan MikroTik

Pada kesempatan kali ini admin ingin sharing langkah-langkah Setting Load Balancing PCC 2 ISP + Fail Over Menggunakan MikroTik. Sebelum ke teknik setting sebaiknya kita pahami terlebih dahulu apa itu load balancing dan fail over.

Load Balancing

Load Balancing merupakan teknik membangun infrastruktur yang high-availability (HA), umumnya digunakan untuk meningkatkan performa dan kehandalan sebuah website, aplikasi, database, networking maupun layanan-layanan lain. Pada bab ini kita menggunakan teknik Load Balancing untuk layanan Networking supaya layanan jaringan yang kita bangun mempunyai high-availability (HA) serta performa dan kehandalan yang baik daripada hanya mengandalkan satu jalur / sumber koneksi internet.

Fail Over

Fail Over merupakan teknik peralihan (switching) kepada sebuah redundant atau standby network ketika koneksi / jalur utama mengalami fail (kegagalan) “down“. Kita menggunakan teknik load balancing untuk membagi beban (load distribution) kepada dua sumber / jalur koneksi yang tersedia, namun belum bisa membuat keduanya saling take over jika salah satu sumber / jalur koneksi mengalami down, maka dari itu perlu teknik fail over untuk melengkapinya.

Berikut topologi jaringan yang kita pakai untuk konfigurasi:

Langkah-langkah Setting Load Balancing PCC 2 ISP + Fail Over:

1. IP Addressing

/ip address
add address=192.168.1.10/24 interface=ether1-IndiHome network=192.168.1.0
add address=192.168.0.10/24 interface=ether2-FirstMedia network=192.168.0.0
add address=192.168.88.1/24 interface=ether3-LAN network=192.168.88.0
add address=192.168.86.254/24 interface=ether4-Server network=192.168.86.0

2. DNS Setting

/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4

3. Firewall Mangle

/ip firewall mangle
add chain=prerouting src-address=192.168.88.0/24 dst-address=192.168.86.0/24 action=accept
add chain=prerouting src-address=192.168.88.0/24 dst-address=192.168.88.0/24 action=accept
add chain=prerouting src-address=192.168.88.0/24 dst-address=192.168.1.0/24 action=accept
add chain=prerouting src-address=192.168.88.0/24 dst-address=192.168.0.0/24 action=accept

add chain=prerouting connection-mark=no-mark in-interface=ether1-IndiHome action=mark-connection new-connection-mark=ISP-A_conn
add chain=output connection-mark=ISP-A_conn action=mark-routing new-routing-mark=via-ISP-A
add chain=prerouting connection-mark=no-mark in-interface=ether2-FirstMedia action=mark-connection new-connection-mark=ISP-B_conn
add chain=output connection-mark=ISP-B_conn action=mark-routing new-routing-mark=via-ISP-B

add chain=prerouting src-address=192.168.88.0/24 per-connection-classifier=both-addresses:2/0 action=mark-connection new-connection-mark=ISP-A_conn passthrough=yes
add chain=prerouting src-address=192.168.88.0/24 connection-mark=ISP-A_conn action=mark-routing new-routing-mark=via-ISP-A passthrough=yes
add chain=prerouting src-address=192.168.88.0/24 per-connection-classifier=both-addresses:2/1 action=mark-connection new-connection-mark=ISP-B_conn passthrough=yes
add chain=prerouting src-address=192.168.88.0/24 connection-mark=ISP-B_conn action=mark-routing new-routing-mark=via-ISP-B passthrough=yes

4. Route

/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=via-ISP-A check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.0.1 routing-mark=via-ISP-B check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.1.1,192.168.0.1

5. NAT

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-IndiHome src-address=192.168.88.0/24
add action=masquerade chain=srcnat out-interface=ether2-FirstMedia src-address=192.168.88.0/24
add action=masquerade chain=srcnat out-interface=ether1-IndiHome src-address=192.168.86.0/24

Sekian & Terimakasih…

Salam Ngoprek.

Penulis & Owner LUKMANLAB, Junior Konsultan IT, Network Engineer, System Administrator.

Tinggal di Desa Wisata Tempur, Jepara.

About Ahmad Lukman Hakim 30 Articles
Penulis & Owner LUKMANLAB, Junior Konsultan IT, Network Engineer, System Administrator. Tinggal di Desa Wisata Tempur, Jepara.

Be the first to comment

Leave a Reply

Your email address will not be published.