Community discussions

MikroTik App
 
yinxiangyn
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Mon May 31, 2010 3:14 pm

How to use different types of PCC load balancing?

Tue Jul 27, 2010 2:26 pm

I want to use "both-addresses" type of load balancing for TCP 80 and 443.
others use "both-addresses and ports" type of load balancing.
But it seems my settings are incorrect, please help me check it
Thanks :shock:
add action=mark-connection chain=input disabled=no in-interface=pppoe-out1 \
    new-connection-mark=pppoe-out1_conn passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out1_conn \
    disabled=no new-routing-mark=to_pppoe-out1 passthrough=yes

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out1_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/0 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out1_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/0

add action=mark-routing chain=prerouting connection-mark=pppoe-out1_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out1 \
    passthrough=yes
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: How to use different types of PCC load balancing?

Tue Jul 27, 2010 3:42 pm

where are your 5 lines?..

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=\
    pppoe-out1_conn passthrough=yes per-connection-classifier=\
    both-addresses-and-ports:2/0

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=\
    pppoe-out2_conn passthrough=yes per-connection-classifier=\
    both-addresses-and-ports:2/1



add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out1_conn passthrough=yes per-connection-classifier=\
    both-addresses:2/0 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out2_conn passthrough=yes per-connection-classifier=\
    both-addresses:2/1 protocol=tcp



add action=mark-routing chain=prerouting connection-mark=pppoe-out1_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out1 \
    passthrough=yes

add action=mark-routing chain=prerouting connection-mark=pppoe-out2_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out2 \
    passthrough=yes
 
yinxiangyn
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Mon May 31, 2010 3:14 pm

Re: How to use different types of PCC load balancing?

Tue Jul 27, 2010 4:05 pm

Thanks Chupaka :)
and yes,5-lines
You do not have the required permissions to view the files attached to this post.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: How to use different types of PCC load balancing?

Tue Jul 27, 2010 4:07 pm

So do you have four more pairs of lines for 5/1 - 5/4?

Can you show your entire PCC configuration?
 
yinxiangyn
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Mon May 31, 2010 3:14 pm

Re: How to use different types of PCC load balancing?

Tue Jul 27, 2010 4:34 pm

So do you have four more pairs of lines for 5/1 - 5/4?

Can you show your entire PCC configuration?
Hi fewi :)
Yes,i have four more pairs of lines for 5/1 - 5/4. too long, I have not put up.
/ip firewall mangle
add action=mark-connection chain=input disabled=no in-interface=pppoe-out1 \
    new-connection-mark=pppoe-out1_conn passthrough=yes 

add action=mark-connection chain=input disabled=no in-interface=pppoe-out2 \
    new-connection-mark=pppoe-out2_conn passthrough=yes

add action=mark-connection chain=input disabled=no in-interface=pppoe-out3 \
    new-connection-mark=pppoe-out3_conn passthrough=yes

add action=mark-connection chain=input disabled=no in-interface=pppoe-out4 \
    new-connection-mark=pppoe-out4_conn passthrough=yes

add action=mark-connection chain=input disabled=no in-interface=pppoe-out5 \
    new-connection-mark=pppoe-out5_conn passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out1_conn \
    disabled=no new-routing-mark=to_pppoe-out1 passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out2_conn \
    disabled=no new-routing-mark=to_pppoe-out2 passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out3_conn \
    disabled=no new-routing-mark=to_pppoe-out3 passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out4_conn \
    disabled=no new-routing-mark=to_pppoe-out4 passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out5_conn \
    disabled=no new-routing-mark=to_pppoe-out5 passthrough=yes

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out1_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/0 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out2_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/1 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out3_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/2 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out4_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/3 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out5_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/4 protocol=tcp

add action=mark-routing chain=prerouting connection-mark=pppoe-out1_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out1 \
    passthrough=yes

add action=mark-routing chain=prerouting connection-mark=pppoe-out2_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out2 \
    passthrough=yes

add action=mark-routing chain=prerouting connection-mark=pppoe-out3_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out3 \
    passthrough=yes

add action=mark-routing chain=prerouting connection-mark=pppoe-out4_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out4 \
    passthrough=yes

add action=mark-routing chain=prerouting connection-mark=pppoe-out5_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out5 \
    passthrough=yes

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out1_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/0

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out2_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/1

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out3_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/2

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out4_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/3

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out5_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/4
You do not have the required permissions to view the files attached to this post.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: How to use different types of PCC load balancing?

Tue Jul 27, 2010 4:47 pm

If that's the order you have them in it won't work. You have to have all the rules with mark-connection above the rules that have an action of mark-routing.

The mark-routing rules set the actual routing mark that lead to PCC load balancing for you. In your case, you're setting connection marks for non HTTP(S) traffic after you have already set routing marks, so that doesn't work and leads to all kind of problems with packets further down the flow going out the wrong gateway.

Move the rules and try again, and please do post your final result and working ruleset as I am sure lots of people will be looking this up.
 
yinxiangyn
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Mon May 31, 2010 3:14 pm

Re: How to use different types of PCC load balancing?

Tue Jul 27, 2010 5:23 pm

If that's the order you have them in it won't work. You have to have all the rules with mark-connection above the rules that have an action of mark-routing.

The mark-routing rules set the actual routing mark that lead to PCC load balancing for you. In your case, you're setting connection marks for non HTTP(S) traffic after you have already set routing marks, so that doesn't work and leads to all kind of problems with packets further down the flow going out the wrong gateway.

Move the rules and try again, and please do post your final result and working ruleset as I am sure lots of people will be looking this up.
Thanks fewi :)
I tried, it works fine.
I always thought "BOTH-ADDRESSRE" type of load balancing rules should be placed at the top, I was wrong.
But I still have some questions I need your guidance ,I found that the removal of INPUT and OUTPUT, it also work.They are necessary?
and I will post my final result and working ruleset.
You do not have the required permissions to view the files attached to this post.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: How to use different types of PCC load balancing?

Tue Jul 27, 2010 5:41 pm

Yes, they also are needed, otherwise you are going to have problems with traffic going from and to the router. It fixed your immediate issue, but would have created new ones.
 
yinxiangyn
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Mon May 31, 2010 3:14 pm

Re: How to use different types of PCC load balancing?

Tue Jul 27, 2010 6:05 pm

Yes, they also are needed, otherwise you are going to have problems with traffic going from and to the router. It fixed your immediate issue, but would have created new ones.
Thanks again :D
/ip firewall mangle
add action=mark-connection chain=input disabled=no in-interface=pppoe-out1 \
    new-connection-mark=pppoe-out1_conn passthrough=yes

add action=mark-connection chain=input disabled=no in-interface=pppoe-out2 \
    new-connection-mark=pppoe-out2_conn passthrough=yes

add action=mark-connection chain=input disabled=no in-interface=pppoe-out3 \
    new-connection-mark=pppoe-out3_conn passthrough=yes

add action=mark-connection chain=input disabled=no in-interface=pppoe-out4 \
    new-connection-mark=pppoe-out4_conn passthrough=yes

add action=mark-connection chain=input disabled=no in-interface=pppoe-out5 \
    new-connection-mark=pppoe-out5_conn passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out1_conn \
    disabled=no new-routing-mark=to_pppoe-out1 passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out2_conn \
    disabled=no new-routing-mark=to_pppoe-out2 passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out3_conn \
    disabled=no new-routing-mark=to_pppoe-out3 passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out4_conn \
    disabled=no new-routing-mark=to_pppoe-out4 passthrough=yes

add action=mark-routing chain=output connection-mark=pppoe-out5_conn \
    disabled=no new-routing-mark=to_pppoe-out5 passthrough=yes

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out1_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/0

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out2_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/1

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out3_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/2

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out4_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/3

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local in-interface=LAN-1 new-connection-mark=pppoe-out5_conn \
    passthrough=yes per-connection-classifier=both-addresses-and-ports:5/4

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out1_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/0 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out2_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/1 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out3_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/2 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out4_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/3 protocol=tcp

add action=mark-connection chain=prerouting disabled=no dst-address-type=\
    !local dst-port=80,443 in-interface=LAN-1 new-connection-mark=\
    pppoe-out5_conn passthrough=yes per-connection-classifier=\
    both-addresses:5/4 protocol=tcp

add action=mark-routing chain=prerouting connection-mark=pppoe-out1_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out1 \
    passthrough=yes

add action=mark-routing chain=prerouting connection-mark=pppoe-out2_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out2 \
    passthrough=yes

add action=mark-routing chain=prerouting connection-mark=pppoe-out3_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out3 \
    passthrough=yes

add action=mark-routing chain=prerouting connection-mark=pppoe-out4_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out4 \
    passthrough=yes

add action=mark-routing chain=prerouting connection-mark=pppoe-out5_conn \
    disabled=no in-interface=LAN-1 new-routing-mark=to_pppoe-out5 \
    passthrough=yes
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: szymonb and 102 guests