summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-23 20:27:05 +0200
committerGitHub <noreply@github.com>2020-04-23 20:27:05 +0200
commite611c5a9d1319f76e689d8ca6ba4a0ea0873d6f9 (patch)
tree4ee3cf3ded9788be93426137e9ea14c1e97bf791
parent1ca8fc0b3f75d63f0751305d8d2d6e6a5f72c5e3 (diff)
parent15d51e0306f3987437f0c4626a396b8ddd4ec646 (diff)
downloadvyos-1x-e611c5a9d1319f76e689d8ca6ba4a0ea0873d6f9.tar.gz
vyos-1x-e611c5a9d1319f76e689d8ca6ba4a0ea0873d6f9.zip
Merge pull request #367 from thomas-mangin/T2352
l2tpv3: T2352: check that the local-ip exists
-rwxr-xr-xsrc/conf_mode/interfaces-l2tpv3.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-l2tpv3.py b/src/conf_mode/interfaces-l2tpv3.py
index 8312d6f37..5e495dd4b 100755
--- a/src/conf_mode/interfaces-l2tpv3.py
+++ b/src/conf_mode/interfaces-l2tpv3.py
@@ -24,7 +24,7 @@ from vyos.config import Config
from vyos.ifconfig import L2TPv3If, Interface
from vyos import ConfigError
from vyos.util import call
-from vyos.validate import is_bridge_member
+from vyos.validate import is_bridge_member, is_addr_assigned
default_config_data = {
'address': [],
@@ -170,6 +170,9 @@ def verify(l2tpv3):
if not l2tpv3['local_address']:
raise ConfigError(f'Must configure the l2tpv3 local-ip for {interface}')
+ if not is_addr_assigned(l2tpv3['local_address']):
+ raise ConfigError(f'Must use a configured IP on l2tpv3 local-ip for {interface}')
+
if not l2tpv3['remote_address']:
raise ConfigError(f'Must configure the l2tpv3 remote-ip for {interface}')