You are on page 1of 2

/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-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 chain=prerouting dst-address=181.129.166.96/29 in-interface=bridge1
add chain=prerouting dst-address=200.116.194.112/29 in-interface=bridge1
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=bridge1 new-connection-mark=WAN1_conn per-connection-classifier=both-
addresses:2/0
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=bridge1 new-connection-mark=WAN2_conn per-connection-classifier=both-
addresses:2/1
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=bridge1 new-connection-mark=WAN1_conn per-connection-classifier=both-
addresses-andports:2/0
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=bridge1 new-connection-mark=WAN2_conn per-connection-classifier=both-
addresses-andports:2/1

**NOTA IMPORTANTE ***INICIO:


both-addresses-and-ports

/ip firewall mangle


add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=bridge1 new-connection-mark=WAN1_conn
add action=mark-connection chain=prerouting dst-address-type=!local in-
interface=bridge1 new-connection-mark=WAN2_conn
***FIN

/ip firewall mangle


add action=mark-routing chain=prerouting connection-mark=WAN1_conn in-interface=
bridge1 new-routing-mark=to_WAN1
add action=mark-routing chain=prerouting connection-mark=WAN2_conn in-interface=
bridge1 new-routing-mark=to_WAN2
***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 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=1 gateway=10.0.0.1
add distance=2 gateway=10.0.0.2
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 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

Fuente para failover: http://wiki.mikrotik.com/wiki/Manual:Using_scope_and_targe t-


scope_attributes Trafico Por Proveedor WAN1
/ip firewall mangle
add action=mark-connection chain=prerouting comment="Https port 443 trafico sep
arado by WAN1" disabled=yes dst-port=443 in-interface=bridge1 new-connection-
mark=Https protocol=tcp
add action=mark-routing chain=prerouting connection-mark=Https disabled=yes in-
interface=bridge1 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=bridge1 new-connection-mark=http
protocol=tcp
add action=mark-routing chain=prerouting connection-mark=http disabled=yes in-
interface=bridge1 new-routing-mark=to_WAN1 passthrough=no
Trafico Por Proveedor WAN2
/ip firewall mangle
add action=mark-connection chain=prerouting comment="Https port 443 trafico
separado by WAN2" dst-port=443 in-interface=bridge1 new-connection-mark=Https
protocol=tcp
add action=mark-routing chain=prerouting connection-mark=Https in-interface=bridge1
new-routing-mark=to_WAN2 passthrough=no
add action=mark-connection chain=prerouting comment="http port 80 Trafico separa do
by WAN2" dst-port=80 in-interface=bridge1 new-connection-mark=http protocol=tcp
add action=mark-routing chain=prerouting connection-mark=http in-interface=bridge1
new-routing-mark=to_WAN2 passthrough=no

You might also like