summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-02-04 16:11:14 +0100
committerGitHub <noreply@github.com>2023-02-04 16:11:14 +0100
commit9ee41e63880ea52d058c90d15837d6ebd48f0a80 (patch)
treef5df010f70d8216d497b5f562e197c9a2e6cacbd /src
parentd56956df82c036d9ca0cb11626265951b970545d (diff)
parentca70102fcf782e7a61d3d1b7672d74eb8db32129 (diff)
downloadvyos-1x-9ee41e63880ea52d058c90d15837d6ebd48f0a80.tar.gz
vyos-1x-9ee41e63880ea52d058c90d15837d6ebd48f0a80.zip
Merge pull request #1603 from nicolas-fort/T2408
T2408: dhcp-relay: Add listen-interface and upstream-interface feature
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/dhcp_relay.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/conf_mode/dhcp_relay.py b/src/conf_mode/dhcp_relay.py
index 4de2ca2f3..07ec1c7a3 100755
--- a/src/conf_mode/dhcp_relay.py
+++ b/src/conf_mode/dhcp_relay.py
@@ -21,6 +21,7 @@ from sys import exit
from vyos.config import Config
from vyos.configdict import dict_merge
from vyos.template import render
+from vyos.base import Warning
from vyos.util import call
from vyos.util import dict_search
from vyos.xml import defaults
@@ -59,6 +60,18 @@ def verify(relay):
raise ConfigError('No DHCP relay server(s) configured.\n' \
'At least one DHCP relay server required.')
+ if 'interface' in relay:
+ if 'upstream_interface' in relay or 'listen_interface' in relay:
+ raise ConfigError('<interface> configuration is not compatible with upstream/listen interface')
+ else:
+ Warning('<interface> is going to be deprecated.\n' \
+ 'Please use <listen-interface> and <upstream-interface>')
+
+ if 'upstream_interface' in relay and 'listen_interface' not in relay:
+ raise ConfigError('No listen-interface configured')
+ if 'listen_interface' in relay and 'upstream_interface' not in relay:
+ raise ConfigError('No upstream-interface configured')
+
return None
def generate(relay):