• Home
  • KONFIGURASI LOADBALANCE VIA CLI(TERMINAL)

KONFIGURASI LOADBALANCE VIA CLI(TERMINAL)

Posted: March 26, 2019, by M Khoirul Anam Romadon .

Categories:

Share:

Pendahuluan

Assalamu'alaikum wr,wb. Kali ini saya akan mengkonfigurasi LOADBALANCE.

Pengertian 

     Load balance pada mikrotik adalah teknik untuk mendistribusikan beban trafik  pada dua atau lebih jalur koneksi secara seimbang, agar trafik dapat berjalan optimal, memaksimalkan throughput, memperkecil waktu tanggap dan menghindari overload pada salah satu jalur koneksi. 

Konfigurasi 

Pada Konfigurasi kali ini saya menggunakan  4-ISP(sumber internet), 4Router yang terhubung ke ISP, dan juga 1Router yang digunakan untuk loadbalance.

4Router yang terhubung dengan ISP kita menggunakan media wireless.
4Router yang terhubung ke Loadbalance menggunakan media Kabel.

Untuk Contoh IP nya :
ISP-1 : 172.16.1.1/29
ISP-2 : 172.16.2.1/29
ISP-3 : 172.16.3.1/29
ISP-4 : 172.16.4.1/29

R1-A :
- 172.16.1.2/29 : wlan
- 192.168.1.1/24 : ether1
R1-B :
- 172.16.2.2/29 : wlan
- 192.168.2.1/24 : ether2
R1-C :
- 172.16.3.2/29 : wlan
- 192.168.3.1/24 : ether3
R1-D :
- 172.16.4.2/29 : wlan
- 192.168.4.1/24 : ether4


Konfigurasi R1-A 
/interface wireless security-profiles
name=profile1 wpa-pre-shared-key=loadbalance

/interface wireless
mode=station-bridge security-profile=profile1 ssid=ISP-1

/ip address
address=172.16.1.2/29 interface=wlan1 network=172.16.1.0
address=192.168.1.1/24 interface=ether1 network=192.168.1.0

/ip firewall nat
add action=masquerade chain=srcnat out-interface=wlan1

/ip route
check-gateway=ping distance=1 gateway=172.16.1.1


Konfigurasi R1-B
/interface wireless security-profiles
name=profile1 wpa-pre-shared-key=loadbalance

/interface wireless
mode=station-bridge security-profile=profile1 ssid=ISP-1

/ip address
address=172.16.2.2/29 interface=wlan1 network=172.16.2.0
address=192.168.2.1/24 interface=ether1 network=192.168.2.0

/ip firewall nat
add action=masquerade chain=srcnat out-interface=wlan1

/ip route
check-gateway=ping distance=1 gateway=172.16.2.1


Konfigurasi R1-C
/interface wireless security-profiles
name=profile1 wpa-pre-shared-key=loadbalance

/interface wireless
mode=station-bridge security-profile=profile1 ssid=ISP-1

/ip address
address=172.16.3.2/29 interface=wlan1 network=172.16.3.0
address=192.168.3.1/24 interface=ether1 network=192.168.3.0

/ip firewall nat
add action=masquerade chain=srcnat out-interface=wlan1

/ip route
check-gateway=ping distance=1 gateway=172.16.3.1


Konfigurasi R1-D
/interface wireless security-profiles
name=profile1 wpa-pre-shared-key=loadbalance

/interface wireless
mode=station-bridge security-profile=profile1 ssid=ISP-1

/ip address
address=172.16.4.2/29 interface=wlan1 network=172.16.4.0
address=192.168.4.1/24 interface=ether1 network=192.168.4.0

/ip firewall nat
add action=masquerade chain=srcnat out-interface=wlan1

/ip route
check-gateway=ping distance=1 gateway=172.16.4.1
 
 
  


Konfigurasi R2(Loadbalance)
/ip address
address=192.168.1.2/24 interface=ether1 network=192.168.1.0
address=192.168.2.2/24 interface=ether2 network=192.168.2.0
address=192.168.3.2/24 interface=ether3 network=192.168.3.0
address=192.168.4.2/24 interface=ether4 network=192.168.4.0
address=192.168.5.1/24 interface=ether5 network=192.168.5.0

/ip firewall mangle
action=accept chain=prerouting dst-address=192.168.1.0/24 in-
interface=ether5
action=accept chain=prerouting dst-address=192.168.2.0/24 in-
interface=ether5
action=accept chain=prerouting dst- addressing=192.168.3.0/24 in-
interface=ether5
action=accept chain=prerouting dst-address=192.168.4.0/24 in-
interface=ether5




/ip firewall mangle
action=mark-connection chain=prerouting connection-mark=no-mark in-
interface=ether1 new-connection-mark=PCC-ISP-1 passthrough=yes

action=mark-connection chain=prerouting connection-mark=no-mark in-
interface=ether2 new-connection-mark=PCC-ISP-2 passthrough=yes

action=mark-connection chain=prerouting connection-mark=no-mark in-
interface=ether3 new-connection-mark=PCC-ISP-3 passthrough=yes

action=mark-connection chain=prerouting connection-mark=no-mark in-
interface=ether4 new-connection-mark=PCC-ISP-4 passthrough=yes


/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark dst-
address-type=!local in-interface=ether5 new-connection-mark=PCC-ISP-1
passthrough=yes per-connection-classifier=both-addresses-and-ports:4/0


add action=mark-connection chain=prerouting connection-mark=no-mark dst-
address-type=!local in-interface=ether5 new-connection-mark=PCC-ISP-2
passthrough=yes per-connection-classifier=both-addresses-and-ports:4/1


add action=mark-connection chain=prerouting connection-mark=no-mark dst-
address-type=!local in-interface=ether5 new-connection-mark=PCC-ISP-3
passthrough=yes per-connection-classifier=both-addresses-and-ports:4/2



add action=mark-connection chain=prerouting connection-mark=no-mark dst-
address-type=!local in-interface=ether5 new-connection-mark=PCC-ISP-4
passthrough=yes per-connection-classifier=both-addresses-and-ports:4/3
/ip firewall mangle
action=mark-routing chain=prerouting connection-mark=PCC-ISP-1 in-
interface=ether5 new-routing-mark=TO-ISP-1 passthrough=yes

action=mark-routing chain=prerouting connection-mark=PCC-ISP-2 in-
interface=ether5 new-routing-mark=TO-ISP-2 passthrough=yes
 
action=mark-routing chain=prerouting connection-mark=PCC-ISP-3 in-
interface=ether5 new-routing-mark=TO-ISP-3 passthrough=yes
 
action=mark-routing chain=prerouting connection-mark=PCC-ISP-4 in-
interface=ether5 new-routing-mark=TO-ISP-4 passthrough=yes
/ip firewall mangle
action=mark-routing chain=output connection-mark=PCC-ISP-1 new-routing-
mark=TO-ISP-1 passthrough=yes
action=mark-routing chain=output connection-mark=PCC-ISP-2 new-routing-
mark=TO-ISP-2 passthrough=yes
action=mark-routing chain=output connection-mark=PCC-ISP-3 new-routing-
mark=TO-ISP-3 passthrough=yes
action=mark-routing chain=output connection-mark=PCC-ISP-4 new-routing-
mark=TO-ISP-4 passthrough=yes

/ip firewall nat
action=masquerade chain=srcnat out-interface=ether1
action=masquerade chain=srcnat out-interface=ether2
action=masquerade chain=srcnat out-interface=ether3
action=masquerade chain=srcnat out-interface=ether4

/ip route
check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=TO-ISP-1
check-gateway=ping distance=2 gateway=192.168.2.1 routing-mark=TO-ISP-2
check-gateway=ping distance=3 gateway=192.168.3.1 routing-mark=TO-ISP-3
check-gateway=ping distance=4 gateway=192.168.4.1 routing-mark=TO-ISP-4
check-gateway=ping distance=1 gateway=192.168.1.1
check-gateway=ping distance=2 gateway=192.168.2.1
check-gateway=ping distance=3 gateway=192.168.3.1
check-gateway=ping distance=4 gateway=192.168.4.1


ScreenShot Konfigurasi





Penutup
Nah itu dia kode(perintah) untuk mengkonfigurasi loadbalance via terminal winbox. Jika kalian ingin mencoba, tinggal menyesuaikan. Sekian Wassalamu'alaikum wr.wb.

Blog Archive

Responsive Ads Here

Subscribe now!