diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2022-10-18 11:41:45 +0000 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2022-10-18 11:41:45 +0000 |
commit | ca70102fcf782e7a61d3d1b7672d74eb8db32129 (patch) | |
tree | ecd3f78edc2d3f2208741004808bd095d438e07c /src | |
parent | 813236e6ca265f15fe81b09a0a61feb3a3d0193b (diff) | |
download | vyos-1x-ca70102fcf782e7a61d3d1b7672d74eb8db32129.tar.gz vyos-1x-ca70102fcf782e7a61d3d1b7672d74eb8db32129.zip |
T2408: dhcp-relay: Add listen-interface and upstream-interface feature
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/dhcp_relay.py | 13 |
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): |