Community discussions

MikroTik App
 
netboyzin
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Thu Mar 21, 2013 3:42 pm

Policy Based Routing

Thu Aug 28, 2014 5:05 pm

Hello

I would like to serve P2P traffic coming from Internet to a Mikrotik Box through a separate high-speed link connecting the customers.

Objective is to bifurcate downstream traffic into 2 parts ( WWW traffic and P2P Traffic ) and serve to the customers by 2 separate links connecting to a downstream L3 switch. Customers are connected to the L3 switch placed below Mikrotik.

Is this possible ? All the Mikrotik documentation for policy based routing solely concentrates on Dual WAN scenario.

Looking forward for some feedback.

Abhishek
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1742
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: Policy Based Routing

Thu Aug 28, 2014 7:56 pm

As long as you have something to match on like a port, protocol or IP host/subnet, then yes, it is possible to policy route in a number of ways beyond the dual wan scenario:

Here is a brief example matching a source of 10.10.10.0/24 and setting a next hop of 10.1.1.2:

ros code

/ip firewall mangle 
add action=mark-packet chain=prerouting new-packet-mark=Policy-Route-1 src-address=10.10.10.0/24
add action=mark-routing chain=prerouting new-routing-mark=Policy-Route-1-RM packet-mark=Policy-Route-1

/ip route
add distance=1 gateway=10.1.1.2 pref-src=10.10.10.0/24 routing-mark=Policy-Route-1-RM
 
netboyzin
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Thu Mar 21, 2013 3:42 pm

Re: Policy Based Routing

Fri Aug 29, 2014 6:28 pm

Thanks Mate.

I missed to include the packet-mark in the mangle rule.

Abhishek