LAGG and Loadbalancing XOR and hashing method - No settings for hashing in GUI and nas.conf

No option to select the hashing method and save settings via the GUI.

You need to set it manually by:

# echo "layer3+4" > /sys/class/net/bond0/bonding/xmit_hash_policy

and save it somewhere in the startup files so that it persists after a restart

Layer 2 (0)
Hash of: src MAC + dst MAC

Layer 2+3 (1) – current default
Hash of: src MAC + dst MAC + src IP + dst IP

Layer 3+4 (2)
Hash of: src IP + dst IP + src PORT + dst PORT

hi

Your switch must properly support LACP.
Some low-end switches do not handle the layer3+4 mode well.

regards

That doesn’t change the fact that, even though the capabilities exist, there’s no way to use them in the GUI.
One more thing—XOR balancing is switch-independent; you don’t need LACP.

damien599901:

Layer 3+4 mode uses information from higher protocol layers. A single TCP/UDP session containing both fragmented and unfragmented packets may be split between two interfaces, which can result in packets being delivered out of order. 802.3ad implementations may or may not tolerate this inconsistency.
This issue applies mostly when the switch must actively participate in aggregation (EtherChannel/LACP). balance-xor ensures consistent per-flow distribution using a configurable hash policy and avoids out-of-order packets (unlike, for example, round-robin).
Problems can arise mainly when packet fragmentation occurs and the switch does not buffer and reassemble them correctly.
In the case of IP fragmentation, a single TCP/UDP session may be split across different physical interfaces, since only the first fragment contains a TCP/UDP header, while subsequent fragments are hashed solely based on Layer 3. This can result in packets being delivered out of order.
But it is very rare occurrence in most installations and applications.

You’re right about the GUI limitation — the capabilities exist, but they are not exposed, so manual configuration is required.
Also agreed: XOR (balance-xor) is switch-independent and does not require LACP.
Regarding Layer3+4, the explanation is technically correct, but a bit overstated in practice.
Packet reordering due to fragmentation can happen in theory, since only the first fragment includes Layer 4 information, while subsequent fragments are hashed at Layer 3.
However, IP fragmentation is quite rare in modern networks (proper MTU, TCP behavior, etc.), and most switches handle such situations without issues.
In real-world deployments, this is almost never a problem.
Layer3+4 remains a very effective hashing policy for load distribution, especially when multiple concurrent connections are involved.

[quote=damien599901 post_id=61763 time=1777407391 user_id=1360]
…

Packet reordering due to fragmentation can happen in theory, since only the first fragment includes Layer 4 information, while subsequent fragments are hashed at Layer 3.

However, IP fragmentation is quite rare in modern networks (proper MTU, TCP behavior, etc.), and most switches handle such situations without issues.

In real-world deployments, this is almost never a problem.

Layer3+4 remains a very effective hashing policy for load distribution, especially when multiple concurrent connections are involved.
[/quote]

Exactly, that’s exactly my point.