0% found this document useful (0 votes)
256 views6 pages

Load Balancing Speedy 3 Line NTH

The document describes how to configure load balancing across three internet connections (speedy1, speedy2, speedy3) using a MikroTik router. It involves: 1) Setting up network address translation (NAT) to masquerade traffic from each interface. 2) Using firewall mangle rules to mark connections and routes for load balancing across the three interfaces. 3) Configuring static routes that direct traffic to the gateways for each interface depending on the routing marks.

Uploaded by

JarrCigra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
256 views6 pages

Load Balancing Speedy 3 Line NTH

The document describes how to configure load balancing across three internet connections (speedy1, speedy2, speedy3) using a MikroTik router. It involves: 1) Setting up network address translation (NAT) to masquerade traffic from each interface. 2) Using firewall mangle rules to mark connections and routes for load balancing across the three interfaces. 3) Configuring static routes that direct traffic to the gateways for each interface depending on the routing marks.

Uploaded by

JarrCigra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Load Balancing Speedy 3 Line NTH

Setting NAT

/ip firewall nat add chain=srcnat action=masquerade out-interface=speedy1
/ip firewall nat add chain=srcnat action=masquerade out-interface=speedy2
/ip firewall nat add chain=srcnat action=masquerade out-interface=speedy3


Setting Buat Mangle

/ip firewall mangle add chain=prerouting action=mark-connection new-
connection-mark=ADSL-1 passthrough=yes connection-state=new in-
interface=lokal nth=3,1 comment="" disabled=no
/ip firewall mangle add chain=prerouting action=mark-routing new-routing-
mark=jalur-1 passthrough=no in-interface=lokal connection-mark=ADSL-1
comment="" disabled=no

/ip firewall mangle add chain=prerouting action=mark-connection new-
connection-mark=ADSL-2 passthrough=yes connection-state=new in-
interface=lokal nth=3,2 comment="" disabled=no
/ip firewall mangle add chain=prerouting action=mark-routing new-routing-
mark=jalur-2 passthrough=no in-interface=lokal connection-mark=ADSL-2
comment="" disabled=no


/ip firewall mangle add chain=prerouting action=mark-connection new-
connection-mark=ADSL-3 passthrough=yes connection-state=new in-
interface=lokal nth=3,1 comment="" disabled=no
/ip firewall mangle add chain=prerouting action=mark-routing new-routing-
mark=jalur-3 passthrough=no in-interface=lokal connection-mark=ADSL-3
comment="" disabled=no

Setting Routenya

/ ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255
target-scope=10 routing-mark=jalur-1 comment="" disabled=no
/ ip route add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255
target-scope=10 routing-mark=jalur-2 comment="" disabled=no
/ ip route add dst-address=0.0.0.0/0 gateway=192.168.3.1 scope=255
target-scope=10 routing-mark=jalur-3 comment="" disabled=no
/ ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255
target-scope=10 comment="primary connection" disabled=no




Setting Load Balancing 3 Line Speedy
Kali Ini topic yang saya angkat adalah Load Balancing, Apa itu load balancing??Load
Balancing disini dapat saya Artikan yaitu Menggabungkan 2 Koneksi atau Lebih kedalam
Gateway disini mesin gateway yang akan kita gunakan adalah MikroTik RB750 ( nduwene
Mung Kui )
Oke Kita akan Coba Oprek Mikocoknya
Saat ini contoh kasusnya kek gini
IP Modem Speedy1 -> 192.168.1.1
IP Modem Speedy2 -> 192.168.2.1
IP Modem Speedy3 -> 192.168.3.1

/interface
set ether1 name=lokal comment="interface mikrotik"
set ether2 name=speedy1 comment="Speedy 1"
set ether3 name=speedy2 comment="speedy 2"
set ether4 name=speedy3 comment="speedy 3"

/ip address
add address=192.168.100.1/24 interface=lokal comment="Local Interface"
add address=192.168.1.2/24 interface=speedy1 comment="Speedy1"
add address=192.168.2.2/24 interface=speedy2 comment="Speedy2"
add address=192.168.3.2/24 interface=speedy3 comment="Speedy3"

/ ip firewall mangle
add chain=prerouting in-interface=lokal connection-state=new nth=3,1 action=mark-
connection \
new-connection-mark=lb_1 passthrough=yes comment="" disabled=no
add chain=prerouting in-interface=lokal connection-mark=lb_1 action=mark-routingnew-
routing-mark=route_1 passthrough=no comment="" disabled=no

add chain=prerouting in-interface=lokal connection-state=new nth=2,1 action=mark-
connection \
new-connection-mark=lb_2 passthrough=yes comment="" disabled=no
add chain=prerouting in-interface=lokal connection-mark=lb_2 action=mark-routing \
new-routing-mark=route_2 passthrough=no comment="" disabled=no

add chain=prerouting in-interface=lokal connection-state=new nth=1,1 action=mark-
connection \
new-connection-mark=lb_3 passthrough=yes comment="" disabled=no
add chain=prerouting in-interface=lokal connection-mark=lb_3 action=mark-routing \
new-routing-mark=route_3 passthrough=no comment="" disabled=no

/ ip firewall nat
add chain=srcnat action=masquerade out-interface=speedy1 comment="" disabled=no
add chain=srcnat action=masquerade out-interface=speedy2 comment="" disabled=no
add chain=srcnat action=masquerade out-interface=speedy3 comment="" disabled=no

/ ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255 target-scope=10 comment=""
disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255 target-scope=10 routing-
mark=route3 comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10 routing-
mark=route4 comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.3.1 scope=255 target-scope=10 routing-
mark=route5 comment="" disabled=no

add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255 target-scope=10 comment=""
check-gateway=ping distance=1 disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10 comment=""
check-gateway=ping distance=2 disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.3.1 scope=255 target-scope=

IP Modem speedy 1 --> 192.168.1.1
IP Modem Speedy 2 --> 192.168.2.1
IP Modem Speedy 3 --> 192.168.3.1

/interface
set ether1 name=lokal comment="interface mikrotik"
set ether2 name=speedy1 comment="Speedy 1"
set ether3 name=speedy2 comment="speedy 2"
set ether4 name=speedy3 comment="speedy 3"

/ip address
add address=192.168.100.1/24 interface=lokal comment="Ip interface mikrotik
yang menuju jaringan lokal"
add address=192.168.1.2/24 interface=speedy1 comment="Ip interface yang
menuju jaringan spedy1"
add address=192.168.2.2/24 interface=speedy2 comment="Ip interface yang
menuju jaringan spedy2"
add address=192.168.3.2/24 interface=speedy3 comment="Ip interface yang
menuju jaringan spedy3"

/ ip firewall mangle
add chain=prerouting in-interface=lokal connection-state=new nth=3,1
action=mark-connection \
new-connection-mark=lb_1 passthrough=yes comment=" disabled=no
add chain=prerouting in-interface=lokal connection-mark=lb_1 action=mark-
routing \
new-routing-mark=route_1 passthrough=no comment=" disabled=no

add chain=prerouting in-interface=lokal connection-state=new nth=2,1
action=mark-connection \
new-connection-mark=lb_2 passthrough=yes comment=" disabled=no
add chain=prerouting in-interface=lokal connection-mark=lb_2 action=mark-
routing \
new-routing-mark=route_2 passthrough=no comment=" disabled=no

add chain=prerouting in-interface=lokal connection-state=new nth=1,1
action=mark-connection \
new-connection-mark=lb_3 passthrough=yes comment=" disabled=no
add chain=prerouting in-interface=lokal connection-mark=lb_3 action=mark-
routing \
new-routing-mark=route_3 passthrough=no comment=" disabled=no

/ ip firewall nat
add chain=srcnat connection-mark=lb_1 action=masquerade out-
interface=speedy1 comment=" disabled=no
add chain=srcnat connection-mark=lb_2 action=masquerade out-
interface=speedy2 comment=" disabled=no
add chain=srcnat connection-mark=lb_3 action=masquerade out-
interface=speedy3 comment=" disabled=no

/ ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255 target-scope=10
comment=" disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255 target-scope=10
routing-mark=route_1 comment=" disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10
routing-mark=route_2 comment=" disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.3.1 scope=255 target-scope=10
routing-mark=route_3 comment=" disabled=no

add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255 target-scope=10
comment=" check-gateway=ping distance=1 disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10
comment=" check-gateway=ping distance=2 disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.3.1 scope=255 target-scope=10
comment=" check-gateway=ping distance=3 disabled=no


Load Balancing NTH
IP address
wan1 : 10.10.10.0/29
wan2 : 11.11.11.0/29
lan : 192.168.1.0/24
Bandwidh :
Wan1 : 1M
Wan2 :512Kbps

Sebelumnya sudah disetting IP NAT dan DNS
1. Seting Mangle
/ip firewall mangle

;;; LoadBalacing
chain=prerouting action=mark-connection new-connection-mark=conn-lb-wan1 passthrough=yes connection-state=new
protocol=tcp src-address=192.168.1.0/24 in-interface=lan-eth3 dst-port=80 nth=2,1

chain=prerouting action=mark-connection new-connection-mark=conn-lb-wan2 passthrough=yes connection-state=new
protocol=tcp src-address=192.168.1.0/24 in-interface=lan-eth3 dst-port=80 nth=1,1

chain=prerouting action=mark-routing new-routing-mark=route-lb1-wan1 passthrough=no src-address=192.168.1.0/24 in-
interface=lan-eth3 connection-mark=conn-lb-wan1

chain=prerouting action=mark-routing new-routing-mark=route-lb2-wan2 passthrough=no src-address=192.168.1.0/24 in-
interface=lan-eth3 connection-mark=conn-lb-wan2

2. Setting Ip Route
/ip route

;;; Default Route dan Fail Over
add dst-address=0.0.0.0/0 gateway=10.10.10.1 distance=1 check-gateway=ping

add dst-address=0.0.0.0/0 gateway=11.11.11.1 distance=2 check-gateway=ping

;;;Load Balancing dan Fail Over
add check-gateway=ping dst-address=0.0.0.0/0 gateway=10.10.10.1 routing-mark=route-lb1-wan1 distance=1

add check-gateway=ping dst-address=0.0.0.0/0 gateway=11.11.11.1 routing-mark=route-lb1-wan1 distance=2

add check-gateway=ping dst-address=0.0.0.0/0 gateway=11.11.11.1 routing-mark=route-lb2-wan2 distance=1

add check-gateway=ping dst-address=0.0.0.0/0 gateway=10.10.10.1 routing-mark=route-lb2-wan2 distance=2



ip address

add address=192.168.1.1/24 network=192.168.1.0 broadcast=192.168.1.255 interface=Local
comment="" \
disabled=no
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=speedy1 \
comment="" disabled=no
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=speedy2 \
comment="" disabled=no
add address=10.113.0.2/24 network=10.113.0.0 broadcast=10.113.0.255 interface=speedy3 \
comment="" disabled=no




/ ip firewall mangle
add chain=prerouting in-interface=Local connection-state=new nth=2,3,0 \
action=mark-connection new-connection-mark=odd passthrough=yes comment="" \
disabled=no
add chain=prerouting in-interface=Local connection-mark=odd action=mark-routing \
new-routing-mark=odd passthrough=no comment="" disabled=no

add chain=prerouting in-interface=Local connection-state=new nth=2,3,1 \
action=mark-connection new-connection-mark=even passthrough=yes comment="" \
disabled=no
add chain=prerouting in-interface=Local connection-mark=even action=mark-routing \
new-routing-mark=even passthrough=no comment="" disabled=no

add chain=prerouting in-interface=Local connection-state=new nth=2,3,2 \
action=mark-connection new-connection-mark=even passthrough=yes comment="" \
disabled=no
add chain=prerouting in-interface=Local connection-mark=even action=mark-routing \
new-routing-mark=even passthrough=no comment="" disabled=no

(((( untuk yg speedy3 marknya gimana?? odd/even atau apa??)))))))


/ ip firewall nat

add chain=srcnat connection-mark=odd action=src-nat to-addresses=10.111.0.2 \
to-ports=0-65535 comment="" disabled=no
add chain=srcnat connection-mark=even action=src-nat to-addresses=10.112.0.2 \
to-ports=0-65535 comment="" disabled=no
add chain=srcnat connection-mark=even action=src-nat to-addresses=10.113.0.2 \
to-ports=0-65535 comment="" disabled=no



/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 routing-mark=odd \
comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 routing-mark=even \
comment="" disabled=no
add dst-address=0.0.0.0/0 gateway=10.113.0.1 scope=255 target-scope=10 routing-mark=even \
comment="" disabled=no

****add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 comment="" \
disabled=no


((((nah yg ini juga sama, tapi yg jelas yang saya kasih tanda **** itu maksudnya apa, kok di ulang 2
kali?? trus gak ada odd/evennya?? gunanya untuk apa sih?? pengaruhnya apa yah??))))

dari yg di atas kalo ada yg salah tolong dibenerin yah, mohon info nya nih.....
( saya koneksi mo coba pake pake 3 line speedy, skrg baru 2)

You might also like