summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-23 15:22:20 +0100
committerGitHub <noreply@github.com>2024-02-23 15:22:20 +0100
commitf54cf0873353da006bb6470e9b5dee7c8c19442d (patch)
treee8c5b084189d52141ecdd8efb5e756362de0823f /data/templates
parentdee663afe5ea0611533fcb1a998cbc8f65aaab9a (diff)
parent6d79c73d4fa2d26197c1bc19df215a204af6c5dd (diff)
downloadvyos-1x-f54cf0873353da006bb6470e9b5dee7c8c19442d.tar.gz
vyos-1x-f54cf0873353da006bb6470e9b5dee7c8c19442d.zip
Merge pull request #3042 from nicolas-fort/T6054
T6054: WLB: fix rules parsing when using multiple ports in one rule
Diffstat (limited to 'data/templates')
-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 %}