Community discussions

MikroTik App
 
eXtremer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 95
Joined: Fri Nov 26, 2010 10:33 am

One IP should use just one gateway on PCC load balancing

Fri Feb 08, 2013 4:47 pm

Hello,

I have 2 providers that work both at the same time using PCC load balacing.
Now, I would like that one PC on my LAN should always use just one gateway (provider), what mangle or another rule should I make in order to accomplish this ?

Thank you

http://img404.imageshack.us/img404/646/pccd.jpg
 
eXtremer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 95
Joined: Fri Nov 26, 2010 10:33 am

Re: One IP should use just one gateway on PCC load balancing

Mon Feb 11, 2013 10:15 am

anyone ?
 
ronix
Member Candidate
Member Candidate
Posts: 151
Joined: Thu Nov 17, 2011 6:51 pm

Re: One IP should use just one gateway on PCC load balancing

Fri Feb 15, 2013 3:35 pm

I think you must mark the connection of this user in mangle....
then rout this mark connection in ip>rout
be careful to the order of the rule.
 
eXtremer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 95
Joined: Fri Nov 26, 2010 10:33 am

Re: One IP should use just one gateway on PCC load balancing

Fri Feb 15, 2013 4:13 pm

I think you must mark the connection of this user in mangle....
then rout this mark connection in ip>rout
be careful to the order of the rule.
I will be more that glad too see an example. Thank you.
 
ronix
Member Candidate
Member Candidate
Posts: 151
Joined: Thu Nov 17, 2011 6:51 pm

Re: One IP should use just one gateway on PCC load balancing

Sat Feb 16, 2013 1:36 pm

try this may be it will wok (I don't have such a case in my lab to test it):

/ip firewall mangle
add action=mark-connection chain=forward disabled=no new-connection-mark=user1_conn passthrough=yes src-address=192.168.1.2
add action=mark-routing chain=output connection-mark=user1_conn disabled=no new-routing-mark=user1 passthrough=no src-address=192.168.1.2
(before your PCC rules)..

/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=WAN1 src-address=192.168.1.2
(before your masquerade rules)..

/ip rout
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.10.10.1 routing-mark=user1 scope=30 target-scope=10

change 192.168.1.2 to your user ip
& 10.10.10.1 to your gate way
 
eXtremer
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 95
Joined: Fri Nov 26, 2010 10:33 am

Re: One IP should use just one gateway on PCC load balancing

Tue Feb 26, 2013 4:36 pm

try this may be it will wok (I don't have such a case in my lab to test it):

/ip firewall mangle
add action=mark-connection chain=forward disabled=no new-connection-mark=user1_conn passthrough=yes src-address=192.168.1.2
add action=mark-routing chain=output connection-mark=user1_conn disabled=no new-routing-mark=user1 passthrough=no src-address=192.168.1.2
(before your PCC rules)..

/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=WAN1 src-address=192.168.1.2
(before your masquerade rules)..

/ip rout
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.10.10.1 routing-mark=user1 scope=30 target-scope=10

change 192.168.1.2 to your user ip
& 10.10.10.1 to your gate way
Unfortunately it doesn't work, I opened about 10 websites that show my static IP, and both providers are shown when it should be just one.
 
ronix
Member Candidate
Member Candidate
Posts: 151
Joined: Thu Nov 17, 2011 6:51 pm

Re: One IP should use just one gateway on PCC load balancing

Wed Feb 27, 2013 12:08 am

ok try this :

(before your PCC rules)..
/ip firewall mangle
add action=mark-routing chain=prerouting disabled=no new-routing-mark=user1 passthrough=no src-address=192.168.1.2
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.10.10.1 routing-mark=user1 scope=30 target-scope=10
the idea is to route this user before PCC to specific gateway, so we must mark his connection and not let it pass to PCC rules, if it didn't work then you must play within this rules...

Who is online

Users browsing this forum: No registered users and 23 guests