0% found this document useful (0 votes)
15 views1 page

Load Balancing

This script configures load balancing across two WAN connections by marking traffic and routing it through specific interfaces, and configures NAT masquerading on each interface. Firewall rules mark connections and routing based on interface, address, and port. Routes are added with routing marks to send traffic through the appropriate WAN gateway or provide failover.

Uploaded by

Jospy
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
0% found this document useful (0 votes)
15 views1 page

Load Balancing

This script configures load balancing across two WAN connections by marking traffic and routing it through specific interfaces, and configures NAT masquerading on each interface. Firewall rules mark connections and routing based on interface, address, and port. Routes are added with routing marks to send traffic through the appropriate WAN gateway or provide failover.

Uploaded by

Jospy
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/ 1

**********2 Wan load balancing Script

/ip firewall mangle


add action=accept chain=prerouting dst-address=192.168.10.0/24
add action=accept chain=prerouting dst-address=192.168.11.0/24
add action=mark-connection chain=input in-interface=WAN1 new-connection-mark=\
WAN1_conn passthrough=yes
add action=mark-connection chain=input in-interface=WAN2 new-connection-mark=\
WAN2_conn passthrough=yes
add action=mark-routing chain=output connection-mark=WAN1_conn \
new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2_conn \
new-routing-mark=to_WAN2 passthrough=yes
add action=mark-connection chain=prerouting dst-address-type=!local \
new-connection-mark=WAN1_conn passthrough=yes per-connection-classifier=\
both-addresses-and-ports:2/0 src-address=192.168.88.0/24
add action=mark-connection chain=prerouting dst-address-type=!local \
new-connection-mark=WAN2_conn passthrough=yes per-connection-classifier=\
both-addresses-and-ports:2/1 src-address=192.168.88.0/24
add action=mark-routing chain=prerouting connection-mark=WAN1__conn \
new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN2__conn \
new-routing-mark=to_WAN2 passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN1
add action=masquerade chain=srcnat out-interface=WAN2
/ip route
add check-gateway=ping distance=1 gateway=192.168.10.1 routing-mark=to_WAN1
add check-gateway=ping distance=1 gateway=192.168.11.1 routing-mark=to_WAN2
add check-gateway=ping distance=1 gateway=192.168.10.1,.192.168.11.1

***********

You might also like