Community discussions

MikroTik App
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Problem PCC Balance + PPPOE Server

Sun Jun 12, 2011 4:49 pm

Hello, I am having a problem that I didn't have before with my PCC balance.

I used to have my clients with fixed private IP address each and the PCC worked excelente. I got traffic in my 4 WAN interfaces.

Yesterday I migrate all my clients connections to PPPoE, I created the PPPoE server, made the secrets and put a PPPoE client in each client's CPE.

Since then the PCC balance only send traffic through one interface, the one with shorter distance.

This is my pcc:

1 chain=input action=mark-connection new-connection-mark=wlan1_conn passthrough=yes in-interface=wlan1/ether2/telmex

2 chain=input action=mark-connection new-connection-mark=wlan2_conn passthrough=yes in-interface=wlan2/ether3/fiber-noc

3 chain=input action=mark-connection new-connection-mark=wlan3_conn passthrough=yes in-interface=wlan3/ether4/FIBERCORP-DEDICADO

4 chain=input action=mark-connection new-connection-mark=wlan4_conn passthrough=yes in-interface=wlan4/ether5/equal

5 chain=output action=mark-routing new-routing-mark=to_wlan1 passthrough=yes connection-mark=wlan1_conn

6 chain=output action=mark-routing new-routing-mark=to_wlan2 passthrough=yes connection-mark=wlan2_conn

7 chain=output action=mark-routing new-routing-mark=to_wlan3 passthrough=yes connection-mark=wlan3_conn

8 chain=output action=mark-routing new-routing-mark=to_wlan4 passthrough=yes connection-mark=wlan4_conn

9 chain=prerouting action=accept dst-address=209.99.234.0/24 in-interface=Local/ether1

10 chain=prerouting action=accept dst-address=190.191.25.0/24 in-interface=Local/ether1

11 chain=prerouting action=accept dst-address=200.89.143.0/24 in-interface=Local/ether1

12 chain=prerouting action=accept dst-address=192.168.81.0/24 in-interface=Local/ether1

13 chain=prerouting action=mark-connection new-connection-mark=wlan1_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/0

14 chain=prerouting action=mark-connection new-connection-mark=wlan1_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/1

15 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/2

16 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/3

17 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/4

18 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/5

22 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/6

23 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/7

24 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/8

25 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/9

30 chain=prerouting action=mark-connection new-connection-mark=wlan4_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/10

31 chain=prerouting action=mark-connection new-connection-mark=wlan4_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/11

32 chain=prerouting action=mark-connection new-connection-mark=wlan4_conn passthrough=yes dst-address-type=!local in-interface=Local/ether1
per-connection-classifier=both-addresses:13/12

33 chain=prerouting action=mark-routing new-routing-mark=to_wlan1 passthrough=yes in-interface=Local/ether1 connection-mark=wlan1_conn

34 chain=prerouting action=mark-routing new-routing-mark=to_wlan2 passthrough=yes in-interface=Local/ether1 connection-mark=wlan2_conn

35 chain=prerouting action=mark-routing new-routing-mark=to_wlan3 passthrough=yes in-interface=Local/ether1 connection-mark=wlan3_conn

36 chain=prerouting action=mark-routing new-routing-mark=to_wlan4 passthrough=yes in-interface=Local/ether1 connection-mark=wlan4_conn

there are also some rules disable in the PCC that is why the number in the begining doesn't mach



I think that the problem is the in-interface, before I changed to PPPoE all the connections were entering from "Local", now, as the PPPoE creates a new tunnel interface for every user, the "Local" interface doesn't match.

How can I fix this? because I can't create one rule for every PPPoE client to make them match.

This must be a common issue, so please let me know how to fix it.

Thanks in advance.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Problem PCC Balance + PPPOE Server

Sun Jun 12, 2011 6:36 pm

Try a negated out-interface. If your WAN interface is called "WAN", use "in-interface=!WAN". If you have multiple interfaces not eligible for PCC make rules that just "accept" packets without passthrough, and then leave off the "out-interface" qualifier immediately. That way the ruled can grab the traffic coming from all the dynamic interfaces. If all of that doesn't work (it should) or gets too complicated get a second router and chain them - one to terminate PPPoE, one further upstream to perform PCC.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Problem PCC Balance + PPPOE Server

Sun Jun 12, 2011 10:11 pm

I have 4 WAN connections, How can I use in-interface=!WAN in this case? Should I put "!WAN" in every place where now is "Local" ? (lines from 9 to 36 in the PCC balance)

I thought about the second router, leaving all the pcc balance in one and PPPoE server in other but as it is a common scenario I figured that there is a solution already.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Problem PCC Balance + PPPOE Server

Sun Jun 12, 2011 10:17 pm

Sorry, duh, of course the whole point of PCC is that you have more than one WAN interface. I hadn't had coffee yet. Go for option number two I listed as it's the only valid one.

Assuming they are called wlan1 - 4, add these:
/ip firewall mangle
add chain=prerouting in-interface=wlan1 action=accept
add chain=prerouting in-interface=wlan2 action=accept
add chain=prerouting in-interface=wlan3 action=accept
add chain=prerouting in-interface=wlan4 action=accept
Then move them so they are between the output chain and prerouting chain rules (starting at rule number 9), and remove the in-interface qualifier from all subsequent rules.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Problem PCC Balance + PPPOE Server

Sun Jun 12, 2011 10:53 pm

Do I also have to remove the "in-interface" indicator from the ACCEPT rules

Like this? :


1 chain=input action=mark-connection new-connection-mark=wlan1_conn passthrough=yes in-interface=wlan1/ether2/telmex

2 chain=input action=mark-connection new-connection-mark=wlan2_conn passthrough=yes in-interface=wlan2/ether3/fiber-noc

3 chain=input action=mark-connection new-connection-mark=wlan3_conn passthrough=yes in-interface=wlan3/ether4/FIBERCORP-DEDICADO

4 chain=input action=mark-connection new-connection-mark=wlan4_conn passthrough=yes in-interface=wlan4/ether5/equal

5 chain=output action=mark-routing new-routing-mark=to_wlan1 passthrough=yes connection-mark=wlan1_conn

6 chain=output action=mark-routing new-routing-mark=to_wlan2 passthrough=yes connection-mark=wlan2_conn

7 chain=output action=mark-routing new-routing-mark=to_wlan3 passthrough=yes connection-mark=wlan3_conn

8 chain=output action=mark-routing new-routing-mark=to_wlan4 passthrough=yes connection-mark=wlan4_conn

9 ;;; AGREGADO FEWI
chain=prerouting action=accept in-interface=wlan1/ether2/telmex

10 chain=prerouting action=accept in-interface=wlan2/ether3/fiber-noc

11 chain=prerouting action=accept in-interface=wlan3/ether4/FIBERCORP-DEDICADO

12 chain=prerouting action=accept in-interface=wlan4/ether5/equal

13 ;;; FIN AGREGADO FEWI
chain=prerouting action=accept dst-address=209.99.234.0/24

14 chain=prerouting action=accept dst-address=190.191.25.0/24

15 chain=prerouting action=accept dst-address=200.89.143.0/24

16 chain=prerouting action=accept dst-address=192.168.81.0/24

17 chain=prerouting action=mark-connection new-connection-mark=wlan1_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

18 chain=prerouting action=mark-connection new-connection-mark=wlan1_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

19 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

20 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

21 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

22 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

23 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

24 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

25 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

26 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

27 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/10

28 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/11

29 chain=prerouting action=mark-connection new-connection-mark=wlan4_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/12

30 chain=prerouting action=mark-connection new-connection-mark=wlan4_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/13

31 chain=prerouting action=mark-connection new-connection-mark=wlan4_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/14

32 chain=prerouting action=mark-routing new-routing-mark=to_wlan1 passthrough=yes connection-mark=wlan1_conn

33 chain=prerouting action=mark-routing new-routing-mark=to_wlan2 passthrough=yes connection-mark=wlan2_conn

34 chain=prerouting action=mark-routing new-routing-mark=to_wlan3 passthrough=yes connection-mark=wlan3_conn

35 chain=prerouting action=mark-routing new-routing-mark=to_wlan4 passthrough=yes connection-mark=wlan4_conn


It seems to be working.

How can I pay you? Are you a consultant?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Problem PCC Balance + PPPOE Server

Sun Jun 12, 2011 11:45 pm

That looks perfect, that is exactly what I meant. Everything above the four new rules stays the same, everything below them drops the in-interface qualifier, just as you're showing in your latest post.

No need for payment. I do not consult. I'm glad it is working for you.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Problem PCC Balance + PPPOE Server

Mon Jun 13, 2011 4:39 am

Thank you very much fewi, I already gave you + Karma,

Have a nice day.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Problem PCC Balance + PPPOE Server

Mon Jun 13, 2011 4:12 pm

Hello, I have a little problem now. It seems like the PCC load balance is redirecting all my traffic, even between CPEs.

I have a PPPoE session for admin, the address is 192.168.201.1, all the CPE get access by PPPoE clientes in 192.168.201.0/24.

Yesterday I could access all the CPE within the network just by connecting with my PPPoE session and entering de CPE address in the web. Now I can't even ping the CPE address.

My guess is that the balance is taking all the traffic and forcing it to go throught Internet and not giving me LAN access.

Where should I put the IP 192.168.201.1 address as exception?

This is the firewall mangle today:

1 ;;; Empieza Balanceo de Cargas
chain=input action=mark-connection new-connection-mark=wlan1_conn passthrough=yes in-interface=wlan1/ether2/telmex

2 chain=input action=mark-connection new-connection-mark=wlan2_conn passthrough=yes in-interface=wlan2/ether3/fiber-noc

3 chain=input action=mark-connection new-connection-mark=wlan3_conn passthrough=yes in-interface=wlan3/ether4/FIBERCORP-DEDICADO

4 chain=input action=mark-connection new-connection-mark=wlan4_conn passthrough=yes in-interface=wlan4/ether5/equal

5 chain=output action=mark-routing new-routing-mark=to_wlan1 passthrough=yes connection-mark=wlan1_conn

6 chain=output action=mark-routing new-routing-mark=to_wlan2 passthrough=yes connection-mark=wlan2_conn

7 chain=output action=mark-routing new-routing-mark=to_wlan3 passthrough=yes connection-mark=wlan3_conn

8 chain=output action=mark-routing new-routing-mark=to_wlan4 passthrough=yes connection-mark=wlan4_conn

9 ;;; AGREGADO FEWI
chain=prerouting action=accept in-interface=wlan1/ether2/telmex

10 chain=prerouting action=accept in-interface=wlan2/ether3/fiber-noc

11 chain=prerouting action=accept in-interface=wlan3/ether4/FIBERCORP-DEDICADO

12 chain=prerouting action=accept in-interface=wlan4/ether5/equal

13 ;;; FIN AGREGADO FEWI
chain=prerouting action=accept dst-address=209.99.234.0/24

14 chain=prerouting action=accept dst-address=190.191.25.0/24

15 chain=prerouting action=accept dst-address=200.89.143.0/24

16 chain=prerouting action=accept dst-address=192.168.81.0/24

17 chain=prerouting action=mark-connection new-connection-mark=wlan1_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

18 chain=prerouting action=mark-connection new-connection-mark=wlan1_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

19 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

20 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

21 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

22 chain=prerouting action=mark-connection new-connection-mark=wlan2_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

23 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

24 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

25 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

26 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local per-connection-classifier=both-addresses:15/>

27 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/10

28 chain=prerouting action=mark-connection new-connection-mark=wlan3_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/11

29 chain=prerouting action=mark-connection new-connection-mark=wlan4_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/12

30 chain=prerouting action=mark-connection new-connection-mark=wlan4_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/13

31 chain=prerouting action=mark-connection new-connection-mark=wlan4_conn passthrough=yes dst-address-type=!local
per-connection-classifier=both-addresses:15/14

32 chain=prerouting action=mark-routing new-routing-mark=to_wlan1 passthrough=yes connection-mark=wlan1_conn

33 chain=prerouting action=mark-routing new-routing-mark=to_wlan2 passthrough=yes connection-mark=wlan2_conn

34 chain=prerouting action=mark-routing new-routing-mark=to_wlan3 passthrough=yes connection-mark=wlan3_conn

35 chain=prerouting action=mark-routing new-routing-mark=to_wlan4 passthrough=yes connection-mark=wlan4_conn


Thank you in advance, again.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Problem PCC Balance + PPPOE Server

Mon Jun 13, 2011 7:07 pm

Try this:

Make an address list that contains all your local IP space - all the IPs assigned to CPEs or elsewhere in your network. Below a simplistic approach that covers all private IPs.
/ip firewall address-list
add list=local-networks address=10.0.0.0/8
add list=local-networks address=172.16.0.0/12
add list=local-networks address=192.168.0.0/16
Then add the below rule, and move it just under the four rules you added for the WAN interfaces:
/ip firewall mangle
add chain=prerouting src-address-list=local-networks dst-address-list=local-networks action=accept
That will exempt all local network traffic from PCC.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Problem PCC Balance + PPPOE Server

Mon Jun 13, 2011 8:27 pm

It works great, but this will allow every client to communicate with each other, not only my admin IP.

Could I use scr-address with only my IP addres (192.168.201.1) to give access only my pc to every CPE on the network?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Problem PCC Balance + PPPOE Server

Mon Jun 13, 2011 8:30 pm

Yes, you could. You'd need two rules, one for the admin IP to the local networks, one for the local networks to the admin IP.
If you don't want CPEs to talk to one another it would also be cleaner to drop the traffic in firewall filters than to rely on policy routing sending the traffic out the wrong interface.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Problem PCC Balance + PPPOE Server

Mon Jun 13, 2011 9:53 pm

I don't want broadcast storms problems. Thats was what I was looking for to when I migrated my Fixed IP networks to PPPoE.

I have a wisp with over 200 clients and it was becoming a problem.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Problem PCC Balance + PPPOE Server

Mon Jun 13, 2011 10:09 pm

Broadcast storms wouldn't propagate across PPPoE links.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Problem PCC Balance + PPPOE Server

Tue Jun 14, 2011 2:40 am

Even if the CPE can talk to each other?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Problem PCC Balance + PPPOE Server

Tue Jun 14, 2011 2:41 am

Even then. Broadcasts are for, well, broadcast networks. Point to point links aren't broadcast networks.
 
emirjonb
just joined
Posts: 2
Joined: Thu Jul 07, 2011 6:55 pm

Re: Problem PCC Balance + PPPOE Server

Thu Jul 07, 2011 7:03 pm

HI
i am a beginner on mikrotik
i have to connect to WAN-s gateway (192.168.0.1 & 192.168.1.1) and three LAN-s(192.168.35.1 & 192.168.45.1 &192.168.55.1) i actually have configured it simple with both gateways at IP-> routes but i have some problems during work and the main problem is for videos on youtube for example they stuck and need a page refresh to be loaded.
i dont know if i can use the PCC technique , i don't use pppoe at all.
thanks in advance
 
emirjonb
just joined
Posts: 2
Joined: Thu Jul 07, 2011 6:55 pm

Re: Problem PCC Balance + PPPOE Server

Sun Jul 10, 2011 11:39 am

any advice ?!?
 
User avatar
moazdabsheh
Frequent Visitor
Frequent Visitor
Posts: 54
Joined: Mon Mar 24, 2014 3:10 am
Location: Palestine

Re: Problem PCC Balance + PPPOE Server

Tue Apr 29, 2014 3:40 pm

HI
i am a beginner on mikrotik
i have to connect to WAN-s gateway (192.168.0.1 & 192.168.1.1) and three LAN-s(192.168.35.1 & 192.168.45.1 &192.168.55.1) i actually have configured it simple with both gateways at IP-> routes but i have some problems during work and the main problem is for videos on youtube for example they stuck and need a page refresh to be loaded.
i dont know if i can use the PCC technique , i don't use pppoe at all.
thanks in advance
search and read and you'll find out.
 
sanketabad
just joined
Posts: 9
Joined: Wed Jun 04, 2014 12:40 am

Re: Problem PCC Balance + PPPOE Server

Fri Feb 19, 2016 8:28 pm

tamahome and fewi... you both have saved my world. I got my PCC working with the help of this post.

Thank you friends...

Who is online

Users browsing this forum: bonamin, Rox169, TomSvitana and 77 guests