Balanceo

bitfrost's picture

/ip firewall address-list
add address=10.10.10.152/29 list=Connected
add address=10.10.11.64/30 list=Connected
add address=172.16.0.0/16 list=Connected
add address=172.16.0.0/16 list=LAN
/ip firewall mangle
add chain=prerouting src-address-list=Connected dst-address-list=Connected action=accept
/ip firewall mangle
add chain=input connection-mark=no-mark in-interface=ether1 action=mark-connection new-connection-mark=ether1_conn
add chain=input connection-mark=no-mark in-interface=ether2 action=mark-connection new-connection-mark=ether2_conn
add chain=output connection-mark=ether1_conn action=mark-routing new-routing-mark=to_ether1
add chain=output connection-mark=ether2_conn action=mark-routing new-routing-mark=to_ether2
/ip firewall mangle
add chain=forward connection-mark=no-mark in-interface=ether1 action=mark-connection new-connection-mark=WAN1->LANs
add chain=forward connection-mark=no-mark in-interface=ether2 action=mark-connection new-connection-mark=WAN2->LANs
add chain=prerouting connection-mark=WAN1->LANs src-address-list=LAN action=mark-routing new-routing-mark=to_ether1
add chain=prerouting connection-mark=WAN2->LANs src-address-list=LAN action=mark-routing new-routing-mark=to_ether2
/ip firewall mangle
add chain=prerouting connection-mark=no-mark src-address-list=LAN dst-address-list=!Connected dst-address-type=!local action=mark-connection new-connection-mark=LAN->WAN
add chain=prerouting connection-mark=LAN->WAN src-address-list=LAN action=mark-routing new-routing-mark=to_ether1 comment="Balanceo"
add chain=prerouting connection-mark=LAN->WAN routing-mark=to_ether1 action=mark-connection new-connection-mark=Sticky_ISP1
add chain=prerouting connection-mark=LAN->WAN routing-mark=to_ether2 action=mark-connection new-connection-mark=Sticky_ISP2
add chain=prerouting connection-mark=Sticky_ISP1 src-address-list=LAN action=mark-routing new-routing-mark=to_ether1
add chain=prerouting connection-mark=Sticky_ISP2 src-address-list=LAN action=mark-routing new-routing-mark=to_ether2