Community discussions

MikroTik App
 
Bene007
just joined
Topic Author
Posts: 18
Joined: Tue Mar 13, 2012 5:06 pm

policy based routing doesnt work

Sun Jun 10, 2012 5:20 pm

Hey guys,

i have a little problem with my mikrotikrouter and i dont know how to fix it. i have 2 wan ports configured. Currently it depends in a manner of speaking by happenstance with what WAN-ip a client reaches the internet. I want that Clients 1-10 reach the internet via pppoe1 and Clients 11-20 reach it via pppoe2.
1   chain=prerouting action=accept dst-address=87.186.224.0/24 
     in-interface=ether3 

2   chain=prerouting action=accept dst-address=217.0.116.0/24 
     in-interface=ether3 

3   chain=prerouting action=mark-connection new-connection-mark=ISP1_conn 
     passthrough=yes in-interface=pppoe1 connection-mark=no-mark 

4   chain=prerouting action=mark-connection new-connection-mark=ISP2_conn 
     passthrough=yes in-interface=pppoe2 connection-mark=no-mark 

5   chain=prerouting action=mark-connection new-connection-mark=ISP1_conn 
     passthrough=yes dst-address-type=!local in-interface=ether3 
     connection-mark=no-mark per-connection-classifier=both-addresses:2/0 

6   chain=prerouting action=mark-connection new-connection-mark=ISP2_conn 
     passthrough=yes dst-address-type=!local in-interface=ether3 
     connection-mark=no-mark per-connection-classifier=both-addresses:2/1 

7   chain=prerouting action=mark-routing new-routing-mark=to_ISP1 
     passthrough=yes in-interface=ether3 connection-mark=ISP1_conn 

8   chain=prerouting action=mark-routing new-routing-mark=to_ISP2 
     passthrough=yes in-interface=ether3 connection-mark=ISP2_conn 

9   chain=output action=mark-routing new-routing-mark=to_ISP1 passthrough=yes 
     connection-mark=ISP1_conn 

10   chain=output action=mark-routing new-routing-mark=to_ISP2 passthrough=yes 
     connection-mark=ISP2_conn 

If i understand correct i have to add following code
 add chain=prerouting  in-interface=LAN connection-mark=no-mark dst-address-type=!local \
    per-connection-classifier=both-addresses:2/0 action=mark-connection new-connection-mark=ISP1_conn 
add chain=prerouting  in-interface=LAN connection-mark=no-mark dst-address-type=!local \ 
    per-connection-classifier=both-addresses:2/1 action=mark-connection new-connection-mark=ISP2_conn 
But i have to change "per-connection-classifier=both-addresses" into "per-connection-classifier=src-address"

Well if i add following code
 add chain=prerouting  in-interface=ether3 connection-mark=no-mark dst-address-type=!local \
    per-connection-classifier=src-address:2/0 action=mark-connection new-connection-mark=ISP1_conn 
add chain=prerouting  in-interface=ether3 connection-mark=no-mark dst-address-type=!local \ 
    per-connection-classifier=src-address:2/1 action=mark-connection new-connection-mark=ISP2_conn 
it doesnt work. Can anyone help, it drives me crazy. Big thanks