Load Balance PCC beda bandwitdh
ISP1 Im3 Oredoo : 192.168.1.1 (30Mbps) ISP2 Tsel : 192.168.2.1 (10Mbps)
PCC beda bandwitdh
===========================================================================================
simulasi load balancing
indihome 192.168.1.1 - tp link 192.168.0.1 (60Mbps)
Mikrotik RB931 ether1 192.168.0.2/24 dns gateway, NAT
ether2 192.168.10.1/24 (dhcp) limit 11M/11M
ether3 192.168.20.1/24 (dhcp) limit 6M/6M
Mikrotik RB952 ether1 192.168.10.2/24 (ISP1)
ether2 192.168.20.2/24 (ISP2)
ether3 192.168.50.1/24 (LAN)
===========================================================================================
/interface ethernet
set numbers=0 name=ether1-ISP1
set numbers=1 name=ether2-ISP2
set numbers=2 name=ether3-LAN
/ip address
add address=192.168.1.2/24 interface=ether1-ISP1
add address=192.168.2.3/24 interface=ether2-ISP2
add address=192.168.50.1/24 interface=ether3-LAN
Jika menambahkan ip secara dhcp-client maka use peer DNS nya NO agar bisa memilih DNS secara manual
IP DNS
ip dns set servers=1.1.1.1,8.8.8.8 allow-remote-requests=yes
Menandai koneksi input pada mangle
ip firewall mangle add action=mark-connection chain=input \ in-interface=ether1-ISP1 new-connection-mark=koneksi_ISP1 \ passthrough=yes comment=koneksi-input-ISP1
ip firewall mangle add action=mark-connection chain=input \ in-interface=ether2-ISP2 new-connection-mark=koneksi_ISP2 \ passthrough=yes comment=koneksi-input-ISP2
Menandai koneksi output pada mangle
ip firewall mangle add action=mark-routing chain=output connection-mark=koneksi_ISP1 \ new-routing-mark=ke_ISP1 passthrough=yes comment=koneksi-output-ISP1
ip firewall mangle add action=mark-routing chain=output connection-mark=koneksi_ISP2 \ new-routing-mark=ke_ISP2 passthrough=yes comment=koneksi-output-ISP2
Menyetujui prerouting modem indihome menuju klien
ip firewall mangle add action=accept chain=prerouting dst-address=192.168.1.0/24 \ in-interface=ether3-LAN comment=prerouting-ISP1-LAN
ip firewall mangle add action=accept chain=prerouting dst-address=192.168.2.0/24 \ in-interface=ether3-LAN comment=prerouting-ISP2-LAN
ip firewall mangle add action=mark-connection chain=prerouting dst-address=!192.168.50.0/24 \ in-interface=ether3-LAN new-connection-mark=koneksi_ISP1 passthrough=yes \ per-connection-classifier=both-addresses-and-ports:2/0 comment=pcc-ISP1-LAN
ip firewall mangle add action=mark-connection chain=prerouting dst-address=!192.168.50.0/24 \ in-interface=ether3-LAN new-connection-mark=koneksi_ISP2 passthrough=yes \ per-connection-classifier=both-addresses-and-ports:2/1 comment=pcc-ISP2-LAN
ip firewall mangle add action=mark-routing chain=prerouting connection-mark=koneksi_ISP1 \ in-interface=ether3-LAN new-routing-mark=ke_ISP1 passthrough=yes comment=menandai-routing-ether3-LAN
ip firewall mangle add action=mark-routing chain=prerouting connection-mark=koneksi_ISP2 \ in-interface=ether3-LAN new-routing-mark=ke_ISP2 passthrough=yes comment=menandai-routing-ether3-LAN
Menambahkan route ke modem
ip route add check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=ke_ISP1 comment=route-ISP1
ip route add check-gateway=ping distance=1 gateway=192.168.2.1 routing-mark=ke_ISP2 comment=route-ISP2
FAIL OVER
ip route add check-gateway=ping distance=1 gateway=192.168.1.1 comment=foISP1
ip route add check-gateway=ping distance=1 gateway=192.168.2.1 comment=foISP2
NAT
ip firewall nat add action=masquerade chain=srcnat out-interface=ether1-ISP1 comment=natISP1
ip firewall nat add action=masquerade chain=srcnat out-interface=ether2-ISP2 comment=natISP2
ip firewall nat add action=masquerade chain=srcnat (NAT Modem untuk ke semua Out Interface )
[admin@MikroTik] > ip dhcp-server setup
Select interface to run DHCP server on
dhcp server interface: ether3-LAN
Pisah trafik youtube
/ip firewall address-list
add address=192.168.50.0/24 list=ether3-LAN
add address=192.168.1.0/24 list=ISP1
add address=192.168.2.0/24 list=ISP2
/ip firewall raw
add action=add-dst-to-address-list address-list=youtube address-list-timeout=none-dynamic chain=prerouting \ content=googlevideo.com dst-address-list=!ether3-LAN src-address-list=ether3-LAN
add action=add-dst-to-address-list address-list=youtube address-list-timeout=none-dynamic chain=prerouting \ content=ytimg.com dst-address-list=!ether3-LAN src-address-list=ether3-LAN
/ip firewall mangle
add action=mark-connection chain=prerouting content=ytimg.com dst-address-list=youtube \ new-connection-mark=C-Youtube passthrough=yes src-address-list=ether3-LAN
add action=mark-connection chain=prerouting content=googlevideo.com dst-address-list=youtube \ new-connection-mark=C-Youtube passthrough=yes src-address-list=ether3-LAN
add action=mark-routing chain=prerouting connection-mark=C-Youtube new-routing-mark=R-Youtube passthrough=yes
/ip route
add check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=R-Youtube (Prioritas utama youtube)
add check-gateway=ping distance=2 gateway=192.168.2.1 routing-mark=R-Youtube (Fail Over)
Pengujian : https://fast.com/ karena fast.com memiliki pengujian multi koneksi & single koneksi.
Jika menggunakan fast.com single koneksi maka 1+1 = 1 (inilah konsep load balance yang benar)
Jika menggunakan fast.com multi koneksi maka 1+1 = 2 (ini hanya berfungsi di aplikasi speedtest yang mendukung multi koneksi, sementara di real device klien tidak mendukung multi koneksi melainkan hanya fail over jika ISP modem1 fail maka akan di over koneksi ke ISP modem2)