I have MPD + Radius running as PPPoE server, and I want to control the bandwidth for each connected user. When a user connect to MPD server, the MPD should run a script that add a new rule to limit the user bandwidth.
I want to do it using Altq + PF, dynamically. I'm searching about it for a while, but nobody knows how to do it, most people recommends use IPFW or authpf but I don't want to "translate" my firewall to IPFW or use both (PF + IPFW).
Would have any way to add new queues using pftcl(8)? Because I need add 2 new queues for each user that connects on server to limit the bandwidth.
One of this queues need to be inside an altq and the other should be created. Ex:
ng0 = Internet conection interface.
This altq is static and only the new queues should be added when a new client connect and removed when he disconnect from server.
To control download I should add a new altq for each new connection. Ex:
I want to do it using Altq + PF, dynamically. I'm searching about it for a while, but nobody knows how to do it, most people recommends use IPFW or authpf but I don't want to "translate" my firewall to IPFW or use both (PF + IPFW).
Would have any way to add new queues using pftcl(8)? Because I need add 2 new queues for each user that connects on server to limit the bandwidth.
One of this queues need to be inside an altq and the other should be created. Ex:
ng0 = Internet conection interface.
This altq is static and only the new queues should be added when a new client connect and removed when he disconnect from server.
Code:
altq on ng0 bandwidth 5Mb cbq queue { up_m1 up_m2 }
queue up_m1 bandwitdh 512Kb cbq(default)
queue up_m2 bandwidth 256Kb cbq
Code:
altq on ng1 bandwidth 1Mb cbq queue down_m1
queue down_m1 bandwidth 1Mb cbq(default)
altq on ng2 bandwitdh 512Kb cbq queue down_m2
queue down_m2 bandwidth 512Kb cbq(default)
pass out on ng0 from 1.2.3.4 to any queue up_m1
pass out on ng1 from any to 1.2.3.4 queue down_m1
pass out on ng0 from 5.6.7.8 to any queue up_m2
pass out on ng2 form any to 5.6.7.8 queue down_m2