summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-wireguard.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-wireguard.py b/src/conf_mode/interfaces-wireguard.py
index 5ceceb592..01f84260d 100755
--- a/src/conf_mode/interfaces-wireguard.py
+++ b/src/conf_mode/interfaces-wireguard.py
@@ -222,6 +222,12 @@ def verify(wg):
if not peer['pubkey']:
raise ConfigError(f'Peer public-key required for peer "{peer_name}"!')
+ if peer['address'] and not peer['port']:
+ raise ConfigError(f'Peer "{peer_name}" port must be defined if address is defined!')
+
+ if not peer['address'] and peer['port']:
+ raise ConfigError(f'Peer "{peer_name}" address must be defined if port is defined!')
+
def apply(wg):
# init wg class