Mikrotik 2 Wan 1 Lan Income
Mikrotik 2 Wan 1 Lan Income
Mikrotik 2 Wan 1 Lan Income
good one
/ip route
add check-gateway=ping dst-address=0.0.0.0/0 gateway=ISP1 table=main ( checks to
see if wan connection is active every 10 secs )
add check-gateway=ping dst-address=0.0.0.0/0 gateway=ISP2 table=main ( checks to
see if wan connection is active every 10 secs )
add dst-address=0.0.0.0/0 gateway=ISP1 table=useWAN1 distance=2 { PCC traffic
marked for ISP1 goes through ISP1 }
add dst-address=0.0.0.0/0 gateway=ISP2 table=useWAN1 distance=4 { PCC traffic
marked for ISP1 goes out ISP2 when ISP1 is not available }
add dst-address=0.0.0.0/0 gateway=ISP2 table=useWAN2 distance=2 { PCC traffic
marked for ISP2 goes through ISP2 }
add dst-address=0.0.0.0/0 gateway=ISP1 table=useWAN2 distance=4 [edit had "2"
earlier by mistake] { PCC traffic marked for ISP2 goes out ISP1 when ISP1 is not
available }
Next we need to mangle traffic Note you stated that WAN2 had more throughput, so
the router selects WAN2 twice for every single selection of WAN1 for sessions.
/mangle
add chain=prerouting action=mark-connection connection-mark=no-mark in-interface-
list=LAN \
new-connection-mark=Mark-WAN1 dst-address-type=!local passthrough=yes \
per-connection-classifier=both-addresses:3/0
add chain=prerouting action=mark-connection connection-mark=no-mark in-interface-
list=LAN \
new-connection-mark=Mark-WAN2 dst-address-type=!local passthrough=yes \
per-connection-classifier=both-addresses:3/1
add chain=prerouting action=mark-connection connection-mark=no-mark in-interface-
list=LAN \
new-connection-mark=Mark-WAN2 dst-address-type=!local passthrough=yes \
per-connection-classifier=both-addresses:3/2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
add chain=prerouting action=mark-routing connection-mark=Mark-WAN1 \
new-routing-mark=useWAN1 passthrough=yes
add chain=prerouting action=mark-routing connection-mark=Mark-WAN2 \
new-routing-mark=useWAN2 passthrough=yes
To ensure any incoming traffic originating from outside the router, IF ANY? (could
be port forwarding, could be wireguard VPN remote in ) you would need some
additional rules.
Optional......
add chain=prerouting action=mark-connection connection-mark=no-mark in-
interface=ISP1 \
new-connection-mark=Incoming-WAN1 passthrough=yes
add chain=prerouting action=mark-connection connection-mark=no-mark in-
interface=ISP2 \
new-connection-mark=Incoming-WAN2 passthrough=yes
++++++++++++++++++++++++++++++++++++++++++
add chain=output action=mark-routing connection-mark=Incoming-WAN1 \
new-routing-mark=useWAN1 passthrough=no
add chain=output action=mark-routing connection-mark=Incoming-WAN2 \
new-routing-mark=useWAN2 passthrough=no
>>>>>>>>>>>>>>>>>>