diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2024-02-23 14:05:13 +0000 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2024-02-23 14:05:13 +0000 |
commit | 6d79c73d4fa2d26197c1bc19df215a204af6c5dd (patch) | |
tree | dbbf4183616c7f49666258fb790c0c45d976f641 /data | |
parent | 72e597d5c258b1730d59d9f8cd08331338cee5b5 (diff) | |
download | vyos-1x-6d79c73d4fa2d26197c1bc19df215a204af6c5dd.tar.gz vyos-1x-6d79c73d4fa2d26197c1bc19df215a204af6c5dd.zip |
T6054: WLB: fix rules parsing when using multiple ports in one rule
Diffstat (limited to 'data')
-rw-r--r-- | data/templates/load-balancing/wlb.conf.j2 | 4 |
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 %} |