#INTERFACE
/interface ethernet
set [ find default-name=ether1 ] arp=proxy-arp name=ether1-LAN
set [ find default-name=ether7 ] name=ether7-SITE
set [ find default-name=ether8 ] name=ether8-DEFAULT
#ADD ADDRESS TO INTERFACE
/ip address
add address=10.10.10.254/24 interface=ether1-LAN network=10.10.10.0
add address=192.168.1.253/24 interface=ether7-SITE network=192.168.1.0
add address=192.168.2.253/24 interface=ether8-DEFAULT network=192.168.2.0
#ADD GATEWAY
/ip route
add comment="DEFAULT GATEWAY" distance=1 gateway=192.168.1.254,192.168.2.254 scope=255
#DNS
/ip dns set allow-remote-requests=yes max-udp-packet-size=512 servers=8.8.8.8,195.170.0.1
#MASQUERADE
/ip firewall nat
add action=masquerade chain=srcnat comment="MASQUERADE SITE-LINE" out-interface=ether7-SITE
add action=masquerade chain=srcnat comment="MASQUERADE DEFAULT-LINE" out-interface=ether8-DEFAULT
add action=masquerade chain=srcnat comment="MASQ-LB LAN" out-interface=ether1-LAN
#LOAD BALANCE PER CONNECTION
/ip firewall mangle
add action=accept chain=prerouting comment="ROUTE SITE-NETWORK" dst-address=192.168.3.0/24 in-interface=ether1-LAN
add action=accept chain=prerouting comment="ROUTE DEFAULT-NETWORK" dst-address=192.168.4.0/24 in-interface=ether1-LAN
add action=mark-connection chain=prerouting comment="Default LINE" connection-state=new dst-address-type=!local in-interface=ether1-LAN new-
connection-mark=ether8DEFAULT_conn passthrough=yes per-connection-classifier=dst-address-and-port:2/0
add action=mark-routing chain=prerouting comment="Default LINE" connection-mark=ether8-DEFAULT_conn in-interface=ether1-LAN new-routing-
mark=to_ether8-DEFAULT passthrough=no
add action=mark-connection chain=prerouting comment="Site LINE" connection-state=new dst-address-type=!local in-interface=ether1-LAN new-
connection-mark=ether7-SITE_conn / passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1
add action=mark-routing chain=prerouting comment="Site LINE" connection-mark=ether7-SITE_conn in-interface=ether1-LAN new-routing-mark=to_ether7-
SITE passthrough=no
#END