You are on page 1of 4

/interface ethernet

set [ find default-name=ether1 ] comment="INTERNET 1"


set [ find default-name=ether2 ] comment="INTERNET 2"
set [ find default-name=ether3 ] comment="INTERNET 3"
set [ find default-name=ether4 ] comment=LAN

/ip address
add address=192.168.122.1/24 interface=ether4 network=192.168.122.0
add address=10.0.1.2/29 interface=ether1 network=10.0.1.0
add address=10.0.2.2/29 interface=ether2 network=10.0.2.0
add address=10.0.3.2/29 interface=ether3 network=10.0.3.0

/ip dhcp-server
add address-pool=dhcp_pool0 interface=ether4 name=dhcp1

/routing table
add disabled=no fib name=to-ISP_A
add disabled=no fib name=to-ISP_B
add disabled=no fib name=to-ISP_C

/ip dns
set servers=8.8.8.8

/ip firewall address-list


add address=192.168.122.0/24 list=local-network
/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 firewall mangle


add action=accept chain=prerouting dst-address-list=local-network src-address-list=local-network

add action=mark-connection chain=input in-interface=ether1 new-connection-mark=koneksi-internet1


passthrough=yes

add action=mark-connection chain=input in-interface=ether2 new-connection-mark=koneksi-internet2


passthrough=yes

add action=mark-connection chain=input in-interface=ether3 new-connection-mark=koneksi-internet3


passthrough=yes

add action=mark-routing chain=output connection-mark=koneksi-internet1 new-routing-mark=to-ISP_A


passthrough=yes

add action=mark-routing chain=output connection-mark=koneksi-internet2 new-routing-mark=to-ISP_B


passthrough=yes

add action=mark-routing chain=output connection-mark=koneksi-internet3 new-routing-mark=to-ISP_C


passthrough=yes
add action=mark-connection chain=prerouting new-connection-mark=conn-wan1 \
passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 \
src-address-list=local-network

add action=mark-connection chain=prerouting new-connection-mark=conn-wan2 \


passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 \
src-address-list=local-network

add action=mark-connection chain=prerouting new-connection-mark=conn-wan3 \


passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 \
src-address-list=local-network

add action=mark-routing chain=prerouting connection-mark=conn-wan1 in-interface=ether4


new-routing-mark=to-ISP_A passthrough=yes

add action=mark-routing chain=prerouting connection-mark=conn-wan2 in-interface=ether4


new-routing-mark=to-ISP_B passthrough=yes

add action=mark-routing chain=prerouting connection-mark=conn-wan3 in-interface=ether4


new-routing-mark=to-ISP_C passthrough=yes
/ip route
add check-gateway=ping dst-address=0.0.0.0/0 gateway=10.0.1.1 routing-table=main

add check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=10.0.1.1 routing-table=to-ISP_A

add check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=10.0.2.1 routing-table=to-ISP_B

add check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=10.0.3.1 routing-table=to-ISP_C

You might also like