summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2022-10-18 11:41:45 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2022-10-18 11:41:45 +0000
commitca70102fcf782e7a61d3d1b7672d74eb8db32129 (patch)
treeecd3f78edc2d3f2208741004808bd095d438e07c /src/conf_mode
parent813236e6ca265f15fe81b09a0a61feb3a3d0193b (diff)
downloadvyos-1x-ca70102fcf782e7a61d3d1b7672d74eb8db32129.tar.gz
vyos-1x-ca70102fcf782e7a61d3d1b7672d74eb8db32129.zip
T2408: dhcp-relay: Add listen-interface and upstream-interface feature
Diffstat (limited to 'src/conf_mode')
-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):