Technical Tip: How to verify link aggregation (LAG, LACP, 802.3ad) algorithm result
Description
Scope
Solution
[ src-mac <mac-addr> ] [ dst-mac <mac-addr> ]
or
[ src-ip <IPv4-addr> ] [ dst-ip <IPv4-addr> ] [ proto <IP-protocol> ] [ src-port <TCP/UDP port> ] [ dst-port <TCP/UDP port> ] [ vlan-id <VLAN-Id> ] [ spi <IPsec-SPI> ] [ frag (offset|flag) ]
Example for L4 hash (default):
> port port4
diagnose netlink aggregate port agg2 src-ip 1.2.3.4 dst-ip 5.6.7.8 proto 6 src-port 64120 dst-port 64125
> port port2
Example for L3 hash:
> port port2
diagnose netlink aggregate port agg2 src-ip 1.2.3.4 dst-ip 5.6.7.9
> port port4
Example for L2 hash:
> port port4
diagnose netlink aggregate port agg2 src-mac 00:10:10:20:30:40 dst-mac 00:50:56:57:58:60
> port port2
Note:
By default in FortiOS, the LAG member selection algorithm for traffic distribution is based on ONLY Layer 4 header information.
Therefore, ICMP and other non-L4 flows may not produce meaningful or distributed results when using the 'diagnose netlink aggregate port <aggregate-interface>' command, since the tool only fully evaluates LAG hashing with L4 fields that are actually present.
Clarification:
- The L2 algorithm ONLY considers the Source and Destination MAC addresses when distributing the traffic across the port members of the LAG.
- The L3 algorithm ONLY considers the Source and Destination IP addresses when distributing the traffic across the port members of the LAG.
- The L4(default) algorithm ONLY considers Source and Destination ports (TCP/UDP) when distributing traffic across the port members of the LAG.
- The source-MAC algorithm ONLY considers the Source-MAC address when distributing the traffic across the port members of the LAG.
Related article:
Technical Tip: Initial troubleshooting steps for LACP (Link Aggregation - 802.3ad)
