0% found this document useful (0 votes)
42 views2 pages

Loadbalance PCC

The document contains firewall mangle rules that mark connections and routing based on the interface and ISP. It includes: 1) Rules to mark connections coming in through ether3-wanA and ether4-wanB interfaces and mark the routing to ensure traffic returns through the same ISP. 2) Rules to load balance traffic from the LAN across two ISPs using connection and address based classifiers to mark connections and routing to direct traffic over wlan1 through either ISP A or B. 3) IP route entries to direct marked routing through the gateways for each ISP based on the routing mark.

Uploaded by

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

Loadbalance PCC

The document contains firewall mangle rules that mark connections and routing based on the interface and ISP. It includes: 1) Rules to mark connections coming in through ether3-wanA and ether4-wanB interfaces and mark the routing to ensure traffic returns through the same ISP. 2) Rules to load balance traffic from the LAN across two ISPs using connection and address based classifiers to mark connections and routing to direct traffic over wlan1 through either ISP A or B. 3) IP route entries to direct marked routing through the gateways for each ISP based on the routing mark.

Uploaded by

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

/ip firewall mangle

add action=mark-connection chain=prerouting comment="InOutSameISP" connection-mark=no-mark in-


interface=ether3-wanA new-connection-mark=conn-WanA

add action=mark-routing chain=output connection-mark=conn-WanA new-routing-mark=lewat-ISP-A

add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether4-wanB


new-connection-mark=conn-WanB

add action=mark-routing chain=output connection-mark=conn-WanB new-routing-mark=lewat-ISP-B

Fungsi script di atas adalah agar paket yang sudah melewati ISP A maka pulang pergi harus melewati ISP
A, begitu juga dengan paket yang melewati ISP B.

/ip firewall mangle

add action=mark-connection chain=prerouting comment="Per Connection Load Balance" dst-


port=80,8080 in-interface=wlan1 new-connection-mark=conn-LanA per-connection-classifier=src-
address-and-port:2/0 protocol=tcp src-address=192.168.50.0/24

add action=mark-routing chain=prerouting connection-mark=conn-LanA in-interface=wlan1 new-routing-


mark=lewat-ISP-A passthrough=no

add action=mark-connection chain=prerouting dst-port=80,8080 in-interface=wlan1 new-connection-


mark=conn-LanB per-connection-classifier=src-address-and-port:2/1 protocol=tcp src-
address=192.168.50.0/24

add action=mark-routing chain=prerouting connection-mark=conn-LanB in-interface=wlan1 new-routing-


mark=lewat-ISP-B passthrough=no

add action=mark-connection chain=prerouting comment="Per Address Load Balance" in-interface=wlan1


new-connection-mark=conn-LanA per-connection-classifier=both-addresses:2/0 src-
address=192.168.50.0/24

add action=mark-routing chain=prerouting connection-mark=conn-LanA in-interface=wlan1 new-routing-


mark=lewat-ISP-A passthrough=no

add action=mark-connection chain=prerouting in-interface=wlan1 new-connection-mark=conn-LanB per-


connection-classifier=both-addresses:2/1 src-address=192.168.50.0/24

add action=mark-routing chain=prerouting connection-mark=conn-LanB in-interface=wlan1 new-routing-


mark=lewat-ISP-B passthrough=no

Fungsi Script di atas adalah, menandai koneksi yang sudah di tentukan berdasarkan classifier dan
membuat routing mark berdasarkan koneksi yang sudah di buat.

/ip route

add distance=1 gateway=192.168.86.1 routing-mark=lewat-ISP-A

add distance=2 gateway=192.168.137.1 routing-mark=lewat-ISP-B

You might also like