You are on page 1of 3

LAN

***Recuerda Modificar tus IP de tu proveedor,


/ip address
add address=192.168.5.2/24 interface=WAN1 network=192.168.5.0
add address=192.168.6.2/24 interface=WAN2 network=192.168.6.0
add address=192.168.7.2/24 interface=WAN3 network=192.168.7.0
add address=192.168.8.2/24 interface=WAN4 network=192.168.8.0
add address=192.168.9.2/24 interface=WAN5 network=192.168.9.0
add address=192.168.1.2/24 interface=LAN network=192.168.1.0

/ip firewall nat


add action=masquerade chain=srcnat out-interface=WAN1
add action=masquerade chain=srcnat out-interface=WAN2
add action=masquerade chain=srcnat out-interface=WAN3
add action=masquerade chain=srcnat out-interface=WAN4
add action=masquerade chain=srcnat out-interface=WAN5

/ip firewall mangle


add action=mark-connection chain=input in-interface=WAN1 new-connection-
mark=WAN1_conn
add action=mark-connection chain=input in-interface=WAN2 new-connection-
mark=WAN2_conn
add action=mark-connection chain=input in-interface=WAN3 new-connection-
mark=WAN3_conn
add action=mark-connection chain=input in-interface=WAN4 new-connection-
mark=WAN4_conn
add action=mark-connection chain=input in-interface=WAN5 new-connection-
mark=WAN5_conn
add action=mark-routing chain=output connection-mark=WAN1_conn new-routing-
mark=to_WAN1
add action=mark-routing chain=output connection-mark=WAN2_conn new-routing-
mark=to_WAN2
add action=mark-routing chain=output connection-mark=WAN3_conn new-routing-
mark=to_WAN3
add action=mark-routing chain=output connection-mark=WAN4_conn new-routing-
mark=to_WAN4
add action=mark-routing chain=output connection-mark=WAN5_conn new-routing-
mark=to_WAN5
add chain=prerouting dst-address=192.168.5.0/24 in-interface=LAN
add chain=prerouting dst-address=192.168.6.0/24 in-interface=LAN
add chain=prerouting dst-address=192.168.7.0/24 in-interface=LAN
add chain=prerouting dst-address=192.168.8.0/24 in-interface=LAN
add chain=prerouting dst-address=192.168.9.0/24 in-interface=LAN
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN1_conn per-connection-classifier=both-
addresses:5/0
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN2_conn per-connection-classifier=both-
addresses:5/1
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN3_conn per-connection-classifier=both-
addresses:5/2
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN4_conn per-connection-classifier=both-
addresses:5/3
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN5_conn per-connection-classifier=both-
addresses:5/4
INICIO: both-addresses-and-ports
/ip firewall mangle
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN1_conn per-connection-classifier=both-
addresses-and-ports:5/0
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN2_conn per-connection-classifier=both-
addresses-and-ports:5/1
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN3_conn per-connection-classifier=both-
addresses-and-ports:5/2
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN4_conn per-connection-classifier=both-
addresses-and-ports:5/3
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=LAN new-connection-mark=WAN5_conn per-connection-classifier=both-
addresses-and-ports:5/4
***FIN

/ip firewall mangle


add action=mark-routing chain=prerouting connection-mark=WAN1_conn in-interface=LAN
new-routing-mark=to_WAN1
add action=mark-routing chain=prerouting connection-mark=WAN2_conn in-interface=LAN
new-routing-mark=to_WAN2
add action=mark-routing chain=prerouting connection-mark=WAN3_conn in-interface=LAN
new-routing-mark=to_WAN3
add action=mark-routing chain=prerouting connection-mark=WAN4_conn in-interface=LAN
new-routing-mark=to_WAN4
add action=mark-routing chain=prerouting connection-mark=WAN5_conn in-interface=LAN
new-routing-mark=to_WAN5

**Importante**
/ip route
add check-gateway=ping distance=1 gateway=8.8.8.8 routing-mark=to_WAN1
add check-gateway=ping distance=2 gateway=8.8.4.4 routing-mark=to_WAN2
add check-gateway=ping distance=3 gateway=4.2.2.2 routing-mark=to_WAN3
add check-gateway=ping distance=4 gateway=8.8.8.8 routing-mark=to_WAN4
add check-gateway=ping distance=5 gateway=8.8.4.4 routing-mark=to_WAN5
add distance=1 gateway=10.0.0.1 routing-mark=to_WAN1
add distance=2 gateway=10.0.0.2 routing-mark=to_WAN2
add distance=3 gateway=10.0.0.3 routing-mark=to_WAN3
add distance=4 gateway=10.0.0.4 routing-mark=to_WAN4
add distance=5 gateway=10.0.0.5 routing-mark=to_WAN5
add distance=1 gateway=10.0.0.1
add distance=2 gateway=10.0.0.2
add distance=3 gateway=10.0.0.3
add distance=4 gateway=10.0.0.4
add distance=5 gateway=10.0.0.5
add distance=1 dst-address=8.8.8.8/32 gateway=192.168.5.1 scope=10
add distance=1 dst-address=8.8.4.4/32 gateway=192.168.6.1 scope=10
add distance=1 dst-address=4.2.2.2/32 gateway=192.168.7.1 scope=10
add distance=1 dst-address=8.8.8.8/32 gateway=192.168.8.1 scope=10
add distance=1 dst-address=8.8.4.4/32 gateway=192.168.9.1 scope=10
add check-gateway=ping distance=1 dst-address=10.0.0.1/32 gateway=8.8.8.8 scope=10
add check-gateway=ping distance=1 dst-address=10.0.0.2/32 gateway=8.8.4.4 scope=10
add check-gateway=ping distance=1 dst-address=10.0.0.3/32 gateway=4.2.2.2 scope=10
add check-gateway=ping distance=1 dst-address=10.0.0.4/32 gateway=8.8.8.8 scope=10
add check-gateway=ping distance=1 dst-address=10.0.0.5/32 gateway=8.8.4.4 scope=10
IP TRAFICO POR WAN1
/ip firewall mangle
add action=mark-connection chain=prerouting comment="Https port 443 trafico
separado by WAN1" disabled=yes dst-port=443 in-interface=LAN new-connection-
mark=Https protocol=tcp
add action=mark-routing chain=prerouting connection-mark=Https disabled=yes in-
interface=LAN new-routing-mark=to_WAN1 passthrough=no
add action=mark-connection chain=prerouting comment="http port 80 Trafico separado
by WAN1" disabled=yes dst-port=80 in-interface=LAN new-connection-mark=http
protocol=tcp
add action=mark-routing chain=prerouting connection-mark=http disabled=yes in-
interface=LAN new-routing-mark=to_WAN1 passthrough=no

IP TRAFICO POR WAN2

/ip firewall mangle


add action=mark-connection chain=prerouting comment="Https port 443 trafico
separado by WAN2" dst-port=443 in-interface=LAN new-connection-mark=Https
protocol=tcp
add action=mark-routing chain=prerouting connection-mark=Https in-interface=LAN
new-routing-mark=to_WAN2 passthrough=no
add action=mark-connection chain=prerouting comment="http port 80 Trafico separado
by WAN2" dst-port=80 in-interface=LAN new-connection-mark=http protocol=tcp
add action=mark-routing chain=prerouting connection-mark=http in-interface=LAN new-
routing-mark=to_WAN2 passthrough=no

You might also like