Yes, it is possible to configure load balancing using the PCC (Per Connection Classifier) method together with HotSpot on the same MikroTik device.
This combination can be very useful for managing traffic load on networks where Internet access is also provided via HotSpot, such as in cafes, hotels or public spaces.
What is PCC and how does it work?
PCC is a load balancing technique in MikroTik's RouterOS that allows connections to be distributed between multiple Internet lines (for example, two ISP connections) based on specific criteria such as IP addresses or ports.
This ensures that multiple sessions or connections from the same client are kept on the same output interface, maintaining session consistency, especially useful to avoid problems in applications that do not handle IP changes well during a single session.
What is HotSpot and how does it work?
HotSpot in MikroTik is a functionality that provides a gateway to connect users to a local network, typically providing authentication and client management.
It is widely used to control Internet access in public places through a login page.
Configuring PCC with HotSpot in MikroTik
To implement both services on the same MikroTik device, you must configure both components to work in harmony, ensuring that HotSpot traffic is properly distributed across ISP lines according to PCC rules.
Here's how you could configure it:
- Configure Interfaces and Internet Connections:
- Make sure all WAN interfaces are configured and can connect to the Internet.
- Configure PCC for Load Balancing:
- Use
mangle
to mark packets and split traffic between available connections.
/ip firewall mangle
add chain=prerouting connection-mark=no-mark in-interface=bridge-local \
action=mark-connection new-connection-mark=ISP1_conn per-connection-classifier=both-addresses-and-ports:2/0
add chain=prerouting connection-mark=no-mark in-interface=bridge-local \
action=mark-connection new-connection-mark=ISP2_conn per-connection-classifier=both-addresses-and-ports:2/1
- Use
- Configure Outgoing Routes:
- Assign routes to split traffic based on connection marks.
/ip route
add dst-address=0.0.0.0/0 gateway=ISP1-gateway routing-mark=ISP1_conn
add dst-address=0.0.0.0/0 gateway=ISP2-gateway routing-mark=ISP2_conn
- Set up HotSpot:
- Set HotSpot to the internal interface where users will connect.
/ip hotspot setup
Final Considerations
- Testing and Monitoring: After configuring PCC and HotSpot, it is crucial to monitor the network to ensure that load balancing is working properly and that HotSpot users have a stable and efficient connection experience.
- Security: Be sure to implement appropriate security measures to protect both HotSpot access and load balancing configuration.
Setting up PCC and HotSpot on the same MikroTik device requires careful planning to ensure that both services operate efficiently and without conflict, thus providing a robust and well-managed network.
There are no tags for this post.
3 comments on “Can load balancing be done with PCC and HotSpot on the same MikroTik device?”
Can PBR and HotSpot be applied on the same MikroTik device?
Regards,
Yes, PBR configurations can be made in MikroTik when you have Hotspot.
Only as a recommendation you should create an address-list (LAN_Networks) in which you add the LAN network addresses you have, then in the MANGLE rule put that address-list (LAN_Networks) in dst-address-list but in denial, that is, activate the small box on the left side when the dst-address-list field is configured. Then you can put in src-address or src-address-list the network or networks to which you want to apply the PBR.
Thank you very much