summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2019-06-19 10:55:13 -0700
committerhagbard <vyosdev@derith.de>2019-06-19 10:55:13 -0700
commit2ee0eff1bd04ef02b0769341eee22543f8011b68 (patch)
treeab61d7fe636ba4b2b116ef7619354232cd2b7e04
parent85c9e0200a4619f0388b7fd7ba9a03f4be933ef5 (diff)
downloadvyos-1x-2ee0eff1bd04ef02b0769341eee22543f8011b68.tar.gz
vyos-1x-2ee0eff1bd04ef02b0769341eee22543f8011b68.zip
[wireguard] T1425 - assign a /31 address on Wireguard interface
- added a validator for checking if the address is any cidr noted address
-rw-r--r--interface-definitions/wireguard.xml2
-rwxr-xr-xsrc/validators/cidr3
2 files changed, 4 insertions, 1 deletions
diff --git a/interface-definitions/wireguard.xml b/interface-definitions/wireguard.xml
index cc86855a5..e752a2f1d 100644
--- a/interface-definitions/wireguard.xml
+++ b/interface-definitions/wireguard.xml
@@ -20,7 +20,7 @@
<properties>
<help>IP address</help>
<constraint>
- <validator name="ip-host"/>
+ <validator name="cidr"/>
</constraint>
<valueHelp>
<format>ipv4-address</format>
diff --git a/src/validators/cidr b/src/validators/cidr
new file mode 100755
index 000000000..815aa8ba1
--- /dev/null
+++ b/src/validators/cidr
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+ipaddrcheck --is-any-cidr $1