From e71bb87517cec1818714f4dd7199a524494c1949 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 17 Oct 2026 20:55:01 +0200 Subject: wlb: T9472: honour per-packet-balancing on rules The renderer checked a key no CLI node produces, so "per-packet-balancing" had no effect and every rule balanced per flow only. With the option set, the rule no longer matches new connections only and every packet is balanced on its own. --- python/vyos/wanloadbalance.py | 3 +- smoketest/scripts/cli/test_load-balancing_wan.py | 41 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/python/vyos/wanloadbalance.py b/python/vyos/wanloadbalance.py index 1dc9a8081..fc9fb1ade 100644 --- a/python/vyos/wanloadbalance.py +++ b/python/vyos/wanloadbalance.py @@ -112,7 +112,8 @@ def nft_rule(rule_conf, rule_id, local=False, exclude=False, limit=False, weight output.append(f'{proto} {prefix}port {operator} @P_{group_name}') - if 'source_based_routing' not in rule_conf and not restore_mark: + # per flow by default - only the first packet of a connection is balanced + if 'per_packet_balancing' not in rule_conf and not restore_mark: output.append('ct state new') if limit and 'limit' in rule_conf and 'rate' in rule_conf['limit']: diff --git a/smoketest/scripts/cli/test_load-balancing_wan.py b/smoketest/scripts/cli/test_load-balancing_wan.py index 686c9e04e..c46c445bb 100755 --- a/smoketest/scripts/cli/test_load-balancing_wan.py +++ b/smoketest/scripts/cli/test_load-balancing_wan.py @@ -117,6 +117,24 @@ class TestLoadBalancingWan(VyOSUnitTestSHIM.TestCase): f'TCP:{lab_target}:{port},connect-timeout=2{bind}