From ca70102fcf782e7a61d3d1b7672d74eb8db32129 Mon Sep 17 00:00:00 2001 From: Nicolas Fort Date: Tue, 18 Oct 2022 11:41:45 +0000 Subject: T2408: dhcp-relay: Add listen-interface and upstream-interface feature --- src/conf_mode/dhcp_relay.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') 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(' configuration is not compatible with upstream/listen interface') + else: + Warning(' is going to be deprecated.\n' \ + 'Please use and ') + + 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): -- cgit v1.2.3