Community discussions

MikroTik App
 
grescho
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Fri Apr 24, 2009 11:07 pm
Location: Murcia, Spain
Contact:

PCC examples of configuration (possible Sticky?)

Mon Nov 02, 2009 12:49 pm

Ok, so I've been using PCC for some while now to provide load balancing over multiple connections to the internet. But everyone I speak to seems to use a slightly different varation of this mangle.
I thought it might be a good idea to post examples of different configurations and the pro's and con's.
Thanks for your support.
 
grescho
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Fri Apr 24, 2009 11:07 pm
Location: Murcia, Spain
Contact:

Re: PCC examples of configuration (possible Sticky?)

Mon Nov 02, 2009 1:07 pm

Ok, so here goes with the first example
Tested with 3.3 and 4.2
Works fine for outgoing load balancing over two dynamically assigned address.
Seem to have slight problem with incoming connections to my HTTP server, as responses sometime get routed through the wrong connection.
/ip firewall mangle
add action=mark-connection chain=input comment="Mark new inbound connection Telefonica1" connection-state=new disabled=no in-interface=Telefonica1 new-connection-mark=Telefonica1 passthrough=yes
add action=mark-connection chain=input comment="Mark new inbound connection Telefonica2" connection-state=new disabled=no in-interface=Telefonica2 new-connection-mark=Telefonica2 passthrough=yes
add action=mark-routing chain=output comment="Mark new inbound route Telefonica1" connection-mark=Telefonica1 disabled=no new-routing-mark=Telefonica1 passthrough=no
add action=mark-routing chain=output comment="Mark new inbound route Telefonica2" connection-mark=Telefonica2 disabled=no new-routing-mark=Telefonica2 passthrough=no
add action=mark-connection chain=prerouting comment="Mark new established connection Telefonica1" connection-state=established disabled=no in-interface=Telefonica1 new-connection-mark=Telefonica1 passthrough=yes
add action=mark-connection chain=prerouting comment="Mark new established connection Telefonica2" connection-state=established disabled=no in-interface=Telefonica2 new-connection-mark=Telefonica2 passthrough=yes
add action=mark-routing chain=output comment="Mark new established route Telefonica1" connection-mark=Telefonica1 connection-state=established disabled=no new-routing-mark=Telefonica1 passthrough=no
add action=mark-routing chain=output comment="Mark new established route Telefonica2" connection-mark=Telefonica2 connection-state=established disabled=no new-routing-mark=Telefonica2 passthrough=no
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=ether9 new-connection-mark=Telefonica1_pcc_conn passthrough=yes per-connection-classifier=both-addresses:2/0
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=ether9 new-connection-mark=Telefonica2_pcc_conn passthrough=yes per-connection-classifier=both-addresses:2/1
add action=mark-routing chain=prerouting comment="" connection-mark=Telefonica1_pcc_conn disabled=no in-interface=ether9 new-routing-mark=Telefonica1 passthrough=yes
add action=mark-routing chain=prerouting comment="" connection-mark=Telefonica2_pcc_conn disabled=no in-interface=ether9 new-routing-mark=Telefonica2 passthrough=yes
add action=mark-routing chain=output comment="" disabled=no dst-address=!192.168.88.0/24 new-routing-mark=Telefonica1 passthrough=no per-connection-classifier=both-addresses:2/0
add action=mark-routing chain=output comment="" disabled=no dst-address=!192.168.88.0/24 new-routing-mark=Telefonica2 passthrough=no per-connection-classifier=both-addresses:2/1

/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=Telefonica1 src-address=192.168.88.0/24
add action=masquerade chain=srcnat comment="" disabled=no out-interface=Telefonica2 src-address=192.168.88.0/24

/ip route
add check-gateway=ping comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=Telefonica1 routing-mark=Telefonica1 scope=255 target-scope=10
add check-gateway=ping comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=Telefonica2 routing-mark=Telefonica2 scope=255 target-scope=10

Who is online

Users browsing this forum: chronos31337, Google [Bot] and 66 guests