Mikrotik Dual Wan

ip firewall mangle add src-address=192.168.57.0/24 action=mark-routing new-routing-mark=net1 chain=prerouting

ip firewall mangle add src-address=192.168.56.2 action=mark-routing new-routing-mark=wan1 chain=output
ip route add gateway=192.168.56.1 routing-mark=wan1

ip firewall mangle add src-address=192.168.58.2 action=mark-routing new-routing-mark=wan2 chain=output
ip route add gateway=192.168.58.1 routing-mark=wan2

-----

NAT
ip firewall nat add chain=src-nat out-interface=ether1 action masquerade
ip firewall nat add chain=src-nat out-interface=ether2 action masquerade
ip firewall nat add chain=src-nat out-interface=ether3 action masquerade

MANGLE
ip firewall mangle add src-address=192.168.59.0/24 action=mark-routing new-routing-mark=admin chain=prerouting
ip firewall mangle add src-address=192.168.56.2 action=mark-routing new-routing-mark=canal_primario chain=output
ip route add gateway=192.168.56.1 routing-mark=canal_primario
ip firewall mangle add src-address=192.168.57.2 action=mark-routing new-routing-mark=canal_secundario chain=output
ip route add gateway=192.168.57.1 routing-mark=canal_secundario
ip firewall mangle add src-address=192.168.58.2 action=mark-routing new-routing-mark=canal_terciario chain=output
ip route add gateway=192.168.58.1 routing-mark=canal_terciario

ROUTE
ip route rule add dst-address=0.0.0.0/0 routing-mark=admin table=canal_primario action=lookup
ip route rule add dst-address=0.0.0.0/0 routing-mark=admin2 table=canal_secundario action=lookup
ip route rule add dst-address=0.0.0.0/0 routing-mark=admin3 table=canal_primario action=lookup
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s