0% found this document useful (0 votes)
107 views1 page

MikroTik Multi-WAN Routing Setup

This document summarizes the IP address and firewall configuration of a MikroTik router with two WAN connections. It shows that the router has IP addresses for two WAN interfaces (WAN-1 and WAN-2) and one LAN interface, and configures firewall rules to mark traffic based on interface and destination in order to route to the correct WAN gateway.

Uploaded by

Amit Bshws
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views1 page

MikroTik Multi-WAN Routing Setup

This document summarizes the IP address and firewall configuration of a MikroTik router with two WAN connections. It shows that the router has IP addresses for two WAN interfaces (WAN-1 and WAN-2) and one LAN interface, and configures firewall rules to mark traffic based on interface and destination in order to route to the correct WAN gateway.

Uploaded by

Amit Bshws
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

@MikroTik] > /ip address print

Flags: X - disabled, I - invalid, D - dynamic


# ADDRESS NETWORK INTERFACE
0 [Link]/24 [Link] WAN-1 - ISP 1
1 [Link]/24 [Link] LAN
2 [Link]/24 [Link] WAN-2 - ISP 2

Gateway : [Link] - WAN-1


[Link] - WAN-2

MikroTik] > /ip firewall mangle print


add chain=prerouting action=accept dst-address=[Link]/24 in-interface=LAN
add chain=prerouting action=accept dst-address=[Link]/24 in-interface=LAN

add chain=prerouting action=mark-connection new-connection-mark=WAN1_conn connection-


mark=no-mark in-interface=WAN-1
add chain=prerouting action=mark-connection new-connection-mark=WAN2_conn connection-
mark=no-mark in-interface=WAN-2

add chain=prerouting action=mark-connection new-connection-mark=WAN1_conn dst-address-type=!


local connection-mark=no-mark in-interface=LAN per-connection-classifier=both-addresses:2/0
add chain=prerouting action=mark-connection new-connection-mark=WAN2_conn dst-address-type=!
local connection-mark=no-mark in-interface=LAN per-connection-classifier=both-addresses:2/1

add chain=prerouting action=mark-routing new-routing-mark=to_WAN1 connection-


mark=WAN1_conn in-interface=LAN
add chain=prerouting action=mark-routing new-routing-mark=to_WAN2 connection-
mark=WAN2_conn in-interface=LAN

add chain=output action=mark-routing new-routing-mark=to_WAN1 connection-mark=ISP1_conn


add chain=output action=mark-routing new-routing-mark=to_WAN2 connection-mark=ISP2_conn

/ ip route
add dst-address=[Link]/0 gateway=[Link] routing-mark=to_WAN1 check-
gateway=ping
add dst-address=[Link]/0 gateway=[Link] routing-mark=to_WAN2 check-
gateway=ping

You might also like