Hi Dear All,
I have a Mikrotik as a router(I mean it does not do NAT) also as a PPPOE server.
I assign predefined IP to my PPPOE client users so I know that what user has what IP?
I want to classify our users to several categories and share specific bandwidth between them.for example, I want to category four of my users and assign 512kbps bandwidth to them as every user has 128kbps dedicated bandwidth and if any of these users disconnected his or her PPPOE connection, his or her dedicated bandwidth share between remain connected users. 
Please help me.
Thanks a lot for your help
Stay happy
Ashakn.
mark all their traffic with packet-mark, then add a queue with max-limit=512k, type=pcq with rate=0
Thanks a lot for your reply.
I add these rules to my mikrotik:
ip firewall mangle add chain=forward src-address=192.168.0.10/32 action=mark-connection new-connection-mark=user1
ip firewall mangle add chain=forward connection-mark=user1 action=mark-packet new-packet-mark=user-packet1
ip firewall mangle add chain=forward src-address=192.168.0.11/32 action=mark-connection new-connection-mark=user2
ip firewall mangle add chain=forward connection-mark=user2 action=mark-packet new-packet-mark=user-packet2
ip firewall mangle add chain=forward src-address=192.168.0.12/32 action=mark-connection new-connection-mark=user3
ip firewall mangle add chain=forward connection-mark=user3 action=mark-packet new-packet-mark=user-packet3
ip firewall mangle add chain=forward src-address=192.168.0.13/32 action=mark-connection new-connection-mark=user4
ip firewall mangle add chain=forward connection-mark=user4 action=mark-packet new-packet-mark=user-packet4
Could you tell me what thing I have to do for limit bandwidth of each of these source IP addresses (192.168.0.10 and 192.168.0.11 and 192.168.0.12 and 192.168.0.13) to 128kbps and maximum rate to 512kbps, As if one of them disconnected, his or her 128kbps bandwidth, share between remianing online users.
Thank you again for your attention.
Stay happy.
Ashkan.
no, mark all with the same packet-mark, then use that mark in queue with max-limit=512k and type=pcq. and in that type, rate should be zero to divide these 512k equally between all active users
I change the firewall rules to these rules:
ip firewall mangle add chain=forward src-address=192.168.0.0/24 action=mark-connection new-connection-mark=user
ip firewall mangle add chain=forward connection-mark=user action=mark-packet new-packet-mark=user-packet
So, really i do not know what command I have to use to create queue for limit bandwidth.
Is it true?
queue type add name pcq kind=pcq pcq-rate=0
queue simple add name=user-limit queue=pcq max-limit=5240288 packet-mark=user-packet
Please advise me.
Best regards.
Ashkan.
http://www.mikrotik.com/testdocs/ros/2.9/root/queue.php , see the bottom, “Equal bandwidth sharing among users”