Community discussions

MikroTik App
 
sioux
newbie
Topic Author
Posts: 47
Joined: Thu May 25, 2006 10:35 pm
Location: Poland/Tarnów

policy routing - logging in problem

Mon Jun 18, 2007 12:04 pm

hi
i've commited a policy routing like described in wiki http://wiki.mikrotik.com/wiki/Policy_Ro ... erOS_2.9.x

every thing looks working good BUT :)
i CANT log in to router via second line

let say i have configuration like this
wan1 (default gateway) 192.168.10.10
wan2 (http pop3 etc) 192.168.20.10
lan1 10.0.0.10

when I connect to router via wan1 .. it's OK
but when I try to connect via wan2 packets which inintiate connection doesnt leave router the same interface from which they came. another words. router routes respons for my request from wan2 via default gateway (wan1) not via wan2 ... and that's why I can log in via wan2 connection

question: what to do with it ?
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Re: policy routing - logging in problem

Mon Jun 18, 2007 8:12 pm

You have to mangle the packets coming in WAN2, then give them another view of the routing table thats for WAN2.

add chain=prerouting in-interface=l2tp-pip \
action=mark-connection \
new-connection-mark=in-pip-conn passthrough=yes \
comment="" disabled=yes
add chain=prerouting connection-mark=in-pip-conn \
action=mark-packet new-packet-mark=in-pip-packet \
passthrough=yes comment="" disabled=yes
add chain=prerouting packet-mark=in-pip-packet \
action=mark-routing new-routing-mark=out-pip \
passthrough=yes comment="" disabled=yes

Mark the connection, then mark the packets, then mark routing. Then, in your routing table, reproduce what you need for WAN2 (include connected routes as well) Add a route rule also (some versions need this, some don't):

/ ip route rule
add routing-mark=out-pip action=lookup table=out-pip \
comment="" disabled=no

Use routing-test package as well.

Sam
 
sioux
newbie
Topic Author
Posts: 47
Joined: Thu May 25, 2006 10:35 pm
Location: Poland/Tarnów

Re: policy routing - logging in problem

Tue Jun 19, 2007 8:32 am

Use routing-test package as well.

Sam
Why ??
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Re: policy routing - logging in problem

Tue Jun 19, 2007 8:07 pm

because i've never used standard routing package and dont know if policy routing and route-marking work the same as I know routing-test does.
 
User avatar
winxp2000
Member Candidate
Member Candidate
Posts: 113
Joined: Mon Jan 30, 2006 8:57 pm
Location: China
Contact:

Re: policy routing - logging in problem

Wed Jun 20, 2007 3:31 pm

Default gateway in MT just leave only one.

So in you situation you should cancel the default gateway.

Using the policy routing in you MT.