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

Load Balancing NTH

This document provides the configuration script for load balancing traffic across two interfaces, ether1 and ether2, using the Network Address Translation (NAT) and NTH load balancing methods. It defines address lists, NAT and routing rules, and firewall rules to mark connections and routes for load balancing every packet in a connection alternately between the two interfaces.

Uploaded by

ata
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)
47 views2 pages

Load Balancing NTH

This document provides the configuration script for load balancing traffic across two interfaces, ether1 and ether2, using the Network Address Translation (NAT) and NTH load balancing methods. It defines address lists, NAT and routing rules, and firewall rules to mark connections and routes for load balancing every packet in a connection alternately between the two interfaces.

Uploaded by

ata
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/ 2

###############################################################

# Load Balancing NTH ("Every" and "Packet") / LB NTH Script Generator


# Date/Time: 9/13/2023, 6:37:11 PM
# Created by: BuanaNETPBun.Github.io - fb.me/buananet.pbun
# Load Balancing Method -> NTH ("Every" and "Packet")
###############################################################
/ip firewall address-list
add address=192.168.0.0/16 list=LOCAL-IP comment="LB NTH by buananetpbun.github.io"
add address=172.16.0.0/12 list=LOCAL-IP comment="LB NTH by buananetpbun.github.io"
add address=10.0.0.0/8 list=LOCAL-IP comment="LB NTH by buananetpbun.github.io"
/ip firewall nat
add chain=srcnat out-interface="ether1" action=masquerade comment="LB NTH by
buananetpbun.github.io"
add chain=srcnat out-interface="ether2" action=masquerade comment="LB NTH by
buananetpbun.github.io"
/ip route
add check-gateway=ping distance=1 gateway="192.168.18.1" routing-mark="to-ether1"
comment="LB NTH by buananetpbun.github.io"
add check-gateway=ping distance=1 gateway="192.168.2.1" routing-mark="to-ether2"
comment="LB NTH by buananetpbun.github.io"
add check-gateway=ping distance=1 gateway="192.168.18.1" comment="LB NTH by
buananetpbun.github.io"
add check-gateway=ping distance=2 gateway="192.168.2.1" comment="LB NTH by
buananetpbun.github.io"
/ip firewall mangle
add action=accept chain=prerouting dst-address-list=LOCAL-IP src-address-list=LOCAL-IP
comment="LB NTH by buananetpbun.github.io"
add action=accept chain=postrouting dst-address-list=LOCAL-IP src-address-list=LOCAL-IP
comment="LB NTH by buananetpbun.github.io"
add action=accept chain=forward dst-address-list=LOCAL-IP src-address-list=LOCAL-IP
comment="LB NTH by buananetpbun.github.io"

add action=accept chain=input dst-address-list=LOCAL-IP src-address-list=LOCAL-IP comment="LB


NTH by buananetpbun.github.io"
add action=accept chain=output dst-address-list=LOCAL-IP src-address-list=LOCAL-IP
comment="LB NTH by buananetpbun.github.io"
add action=mark-connection chain=prerouting in-interface="ether1" new-connection-mark="cm-
ether1" passthrough=yes comment="LB NTH by buananetpbun.github.io"
add action=mark-connection chain=prerouting in-interface="ether2" new-connection-mark="cm-
ether2" passthrough=yes comment="LB NTH by buananetpbun.github.io"
add action=mark-routing chain=output connection-mark="cm-ether1" new-routing-mark="to-
ether1" passthrough=yes comment="LB NTH by buananetpbun.github.io"
add action=mark-routing chain=output connection-mark="cm-ether2" new-routing-mark="to-
ether2" passthrough=yes comment="LB NTH by buananetpbun.github.io"
add action=mark-connection chain=prerouting new-connection-mark="cm-ether1"
passthrough=yes connection-state=new nth=2,1 dst-address-list=!LOCAL-IP src-address-
list=LOCAL-IP comment="LB NTH by buananetpbun.github.io"
add action=mark-connection chain=prerouting new-connection-mark="cm-ether2"
passthrough=yes connection-state=new nth=2,2 dst-address-list=!LOCAL-IP src-address-
list=LOCAL-IP comment="LB NTH by buananetpbun.github.io"
add action=mark-routing chain=prerouting connection-mark="cm-ether1" new-routing-mark="to-
ether1" passthrough=yes dst-address-list=!LOCAL-IP src-address-list=LOCAL-IP comment="LB
NTH by buananetpbun.github.io"
add action=mark-routing chain=prerouting connection-mark="cm-ether2" new-routing-mark="to-
ether2" passthrough=yes dst-address-list=!LOCAL-IP src-address-list=LOCAL-IP comment="LB
NTH by buananetpbun.github.io"

You might also like