summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-01-04 10:51:51 +0200
committerGitHub <noreply@github.com>2023-01-04 10:51:51 +0200
commitf5af95be4f66380d213771b975c63361e27616ef (patch)
tree49c9eb0eb50aa33fda890a7b770a60e35a761f33 /src/conf_mode
parent6c78e460861419aa7a05a47ee779aaddd37cd14a (diff)
parent49234912119c224bf4c28df5573937668d03e651 (diff)
downloadvyos-1x-f5af95be4f66380d213771b975c63361e27616ef.tar.gz
vyos-1x-f5af95be4f66380d213771b975c63361e27616ef.zip
Merge pull request #1735 from sever-sever/T4904
T4904: keepalived virtual-server allow multiple ports with fwmark
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/high-availability.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/conf_mode/high-availability.py b/src/conf_mode/high-availability.py
index 8a959dc79..4ed16d0d7 100755
--- a/src/conf_mode/high-availability.py
+++ b/src/conf_mode/high-availability.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2018-2022 VyOS maintainers and contributors
+# Copyright (C) 2018-2023 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -144,8 +144,10 @@ def verify(ha):
# Virtual-server
if 'virtual_server' in ha:
for vs, vs_config in ha['virtual_server'].items():
- if 'port' not in vs_config:
- raise ConfigError(f'Port is required but not set for virtual-server "{vs}"')
+ if 'port' not in vs_config and 'fwmark' not in vs_config:
+ raise ConfigError(f'Port or fwmark is required but not set for virtual-server "{vs}"')
+ if 'port' in vs_config and 'fwmark' in vs_config:
+ raise ConfigError(f'Cannot set both port and fwmark for virtual-server "{vs}"')
if 'real_server' not in vs_config:
raise ConfigError(f'Real-server ip is required but not set for virtual-server "{vs}"')
# Real-server