hi all i have two internet line and make loadbalance with ppc and work very well i use the folowing scipt
/ ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=wlan1
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=wlan2
/ ip firewall nat
add chain=srcnat out-interface=wlan1 action=masquerade
add chain=srcnat out-interface=wlan2 action=masquerade
i want to know what The difference between
per-connection-classifier=both-addresses
per-connection-classifier=both-addresses and port
per-connection-classifier=src-addresses
per-connection-classifier=src-addresses and port
and which one it better
thanks a lot
PCC takes certain fields from the IP header (both-addresses|both-ports|dst-address-and-port|src-address|src-port|both-addresses-and-ports|dst-address|dst-port|src-address-and-port) and hashes them. It then divides the hash by the denominator (the first number after the colon) and compares the remainder to the second number after the colon. If they are equal, it matches.
Hashes always generate the same output for the same input. So if you use src-address as the only field to hash, connections from the same source address will always match the same PCC matcher, and in your example will always be assigned the same routing mark and therefore go out the same WAN link. Correspondingly, if you were to use only the dst-address field, all connections from any clients to the same server on the Internet would always go through the same WAN link.
There’s no generic answer on which fields are ‘better’, it depends on what you’re trying to do. If you’re trying to spread load as evenly as possible across the links ‘both-addresses-and-ports’ is probably the best option as it would pick a WAN link very randomly since you’re hashing across fields that change even for consecutive (but new) connections between the same two endpoints.
thanks for reply I want to know the explanation of
per-connection-classifier=src-addresses and port
per-connection-classifier=both-addresses and port
to use one of them
Thank you for the clarification I want to be equal to distribute the load on both lines
when i use “src-addresses and port” What happens
when i use “both-addresses and port” What happens
when i use “dst-addresses and port” What happens