0% found this document useful (0 votes)
413 views

Load Balance Mikrotik 2 Isp

This document configures IP addresses, DNS, firewall rules, NAT, and routing on a router with 3 Ethernet interfaces connected to 2 ISPs and a local network. Firewall rules mark incoming and outgoing connections by interface and ISP for policy-based routing over each ISP connection. NAT is applied to traffic exiting each ISP interface. Routing marks connections to prefer one ISP gateway over the other based on availability.

Uploaded by

Bersama Ukhuwah
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
413 views

Load Balance Mikrotik 2 Isp

This document configures IP addresses, DNS, firewall rules, NAT, and routing on a router with 3 Ethernet interfaces connected to 2 ISPs and a local network. Firewall rules mark incoming and outgoing connections by interface and ISP for policy-based routing over each ISP connection. NAT is applied to traffic exiting each ISP interface. Routing marks connections to prefer one ISP gateway over the other based on availability.

Uploaded by

Bersama Ukhuwah
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

/ip address

add address=192.168.90.2/30 comment=ISP-1 interface=ether1 network=192.168.90.0


add address=192.168.91.2/30 comment=ISP-2 interface=ether2 network=192.168.91.0
add address=192.168.1.1/24 comment="Local Network" interface=ether3
network=192.168.1.0

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

/ip firewall mangle


add action=mark-connection chain=input connection-state=new in-interface=ether1
new-connection-mark=ISP-1 passthrough=yes
add action=mark-connection chain=input connection-state=new in-interface=ether2
new-connection-mark=ISP-2 passthrough=yes

add action=mark-routing chain=output connection-mark=ISP-1 new-routing-mark=Jalur-1


passthrough=no
add action=mark-routing chain=output connection-mark=ISP-2 new-routing-mark=Jalur-2
passthrough=no

add action=mark-connection chain=prerouting dst-address-type=!local in-


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

add action=mark-routing chain=prerouting connection-mark=ISP-1 in-interface=ether3


new-routing-mark=Jalur-1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP-2 in-interface=ether3
new-routing-mark=Jalur-2 passthrough=yes

/ip firewall nat


add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2

/ip route
add check-gateway=ping distance=1 gateway=192.168.200.1 routing-mark=Jalur-1
add check-gateway=ping distance=2 gateway=192.168.100.1 routing-mark=Jalur-2

add distance=1 gateway=192.168.200.1


add distance=2 gateway=192.168.100.1

You might also like