summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-24 10:04:26 +0100
committerGitHub <noreply@github.com>2024-02-24 10:04:26 +0100
commit660c969718f8e4a7771336d0b8a380949ed9b174 (patch)
tree87c5885c8a14ed72167239ccfc7f229a37c28709
parent88911dbdf78ea1d82dde08eff19f9f3eed7448dd (diff)
parent068418ef218eb0109c5df6d325f05a6f3b22ee55 (diff)
downloadvyos-1x-660c969718f8e4a7771336d0b8a380949ed9b174.tar.gz
vyos-1x-660c969718f8e4a7771336d0b8a380949ed9b174.zip
Merge pull request #3043 from vyos/mergify/bp/sagitta/pr-3042
T6054: WLB: fix rules parsing when using multiple ports in one rule (backport #3042)
-rw-r--r--data/templates/load-balancing/wlb.conf.j24
1 files changed, 4 insertions, 0 deletions
diff --git a/data/templates/load-balancing/wlb.conf.j2 b/data/templates/load-balancing/wlb.conf.j2
index 6557b6f4c..7f04d797e 100644
--- a/data/templates/load-balancing/wlb.conf.j2
+++ b/data/templates/load-balancing/wlb.conf.j2
@@ -93,6 +93,8 @@ rule {{ rule }} {
{% if rule_config.destination.port is vyos_defined %}
{% if '-' in rule_config.destination.port %}
port-ipt "-m multiport --dports {{ rule_config.destination.port | replace('-', ':') }}"
+{% elif ',' in rule_config.destination.port %}
+ port-ipt "-m multiport --dports {{ rule_config.destination.port }}"
{% else %}
port-ipt " --dport {{ rule_config.destination.port }}"
{% endif %}
@@ -107,6 +109,8 @@ rule {{ rule }} {
{% if rule_config.source.port is vyos_defined %}
{% if '-' in rule_config.source.port %}
port-ipt "-m multiport --sports {{ rule_config.source.port | replace('-', ':') }}"
+{% elif ',' in rule_config.destination.port %}
+ port-ipt "-m multiport --sports {{ rule_config.source.port }}"
{% else %}
port.ipt " --sport {{ rule_config.source.port }}"
{% endif %}