AKZN Notes

Archives for My Lazy and Forgetful Mind

MikroTik PPPoE Bandwidth Management with RADIUS

Step 1: Configure PPPoE

  1. Basic PPPoE Setup:
    • Set up your PPPoE server as you normally would. Ensure that you have configured the necessary interfaces and settings.

Step 2: RADIUS Configuration

  1. Add RADIUS Attributes:
    • In your RADIUS server, add the reply attribute Mikrotik-Address-List.
    • This attribute will automatically add the IP address of the client logging in to a specified address list. For example, set the attribute value to pppoe_paket10.

Step 3: Mangle Rules Setup

  1. Mark Connection:

    • Use the following command to create a mangle rule that marks connections based on the address list:

      for pppoe mangle, generally its better to use chain forward than prerouting

    /ip firewall mangle add chain=forward src-address-list=range_pppoe_ip_list action=mark-connection new-connection-mark=CON-PPPOE
  2. Mark Packets:

    • Add another mangle rule to mark packets using the connection mark:
    /ip firewall mangle add chain=forward connection-mark=CON-PPPOE src-address-list=pppoe_paket10 action=mark-packet new-packet-mark=pppoe_packet

Step 4: Queue Tree Configuration

  1. Add Queue Trees:

    • Create queue trees using the packet mark defined above. For example:
    /queue tree add name="PPPoE Download Queue" parent=global queue=default packet-mark=pppoe_packet limit-at=1M max-limit=10M

Summary

This setup allows you to effectively manage bandwidth for PPPoE clients based on their RADIUS profiles. By using the Mikrotik-Address-List attribute, you can dynamically manage IP addresses and apply appropriate bandwidth limitations.

Leave a Reply

Your email address will not be published.