100% found this document useful (1 vote)
1K views2 pages

Setting Mikrotik LoadBalance 3 ISP No Lopping Ping Imut Full Script

This document configures a network with 3 ISPs and load balancing between them. It creates a bridge with DHCP and assigns IP addresses. It uses IP firewall mangle rules to mark traffic by source and destination for load balancing. NAT is configured for the 3 interfaces. Routing marks traffic and load balances between the 3 ISP gateways.

Uploaded by

Zhon Ocas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views2 pages

Setting Mikrotik LoadBalance 3 ISP No Lopping Ping Imut Full Script

This document configures a network with 3 ISPs and load balancing between them. It creates a bridge with DHCP and assigns IP addresses. It uses IP firewall mangle rules to mark traffic by source and destination for load balancing. NAT is configured for the 3 interfaces. Routing marks traffic and load balances between the 3 ISP gateways.

Uploaded by

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

/interface bridge

add name=bridge1
/interface ethernet
set [ find default-name=ether1 ]
set [ find default-name=ether2 ]
set [ find default-name=ether3 ]
/ip pool
add name=dhcp_pool0 ranges=11.11.10.2-11.11.10.254
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=bridge1 name=dhcp1
/interface bridge port
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5
/ip address
add address=192.168.18.2/24 interface=ether1 network=192.168.5.0
add address=192.168.17.2/24 interface=ether2 network=192.168.6.0
add address=192.168.100.2/24 interface=ether3 network=192.168.7.0
add address=11.11.10.2/24 interface=bridge1 network=192.168.100.0
/ip dhcp-server network
add address=11.11.10.0/24 gateway=192.168.100.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip firewall address-list
add address=192.168.18.0/24 list=lokal
add address=192.168.17.0/24 list=lokal
add address=192.168.100.0/24 list=lokal
add address=11.11.10.0/24 list=lokal
/ip firewall mangle
add action=mark-connection chain=prerouting in-interface=ether1 \
new-connection-mark=isp1 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether2 \
new-connection-mark=isp2 passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether3 \
new-connection-mark=isp3 passthrough=yes
add action=mark-connection chain=prerouting dst-address-list=!lokal \
in-interface=bridge1 new-connection-mark=isp3 passthrough=yes \
per-connection-classifier=src-address-and-port:3/0 src-address-list=lokal
add action=mark-connection chain=prerouting dst-address-list=!lokal \
in-interface=bridge1 new-connection-mark=isp2 passthrough=yes \
per-connection-classifier=src-address-and-port:3/1 src-address-list=lokal
add action=mark-connection chain=prerouting dst-address-list=!lokal \
in-interface=bridge1 new-connection-mark=isp1 passthrough=yes \
per-connection-classifier=src-address-and-port:3/2 src-address-list=lokal
add action=mark-routing chain=prerouting connection-mark=isp3 \
dst-address-list=!lokal new-routing-mark=isp3 passthrough=yes \
src-address-list=lokal
add action=mark-routing chain=prerouting connection-mark=isp2 \
dst-address-list=!lokal new-routing-mark=isp2 passthrough=yes \
src-address-list=lokal
add action=mark-routing chain=prerouting connection-mark=isp1 \
dst-address-list=!lokal new-routing-mark=isp1 passthrough=yes \
src-address-list=lokal
add action=mark-routing chain=output connection-mark=isp3 new-routing-mark=\
isp3 passthrough=yes
add action=mark-routing chain=output connection-mark=isp2 new-routing-mark=\
isp2 passthrough=yes
add action=mark-routing chain=output connection-mark=isp1 new-routing-mark=\
isp1 passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2
add action=masquerade chain=srcnat out-interface=ether3
/ip route
add check-gateway=ping distance=1 gateway=192.168.18.1 routing-mark=isp3
add check-gateway=ping distance=2 gateway=192.168.17.1 routing-mark=isp2
add check-gateway=ping distance=3 gateway=192.168.100.1 routing-mark=isp1
add distance=1 gateway=192.168.18.1,192.168.17.1,192.168.100.1
/system clock
set time-zone-name=Asia/Jakarta

You might also like