summaryrefslogtreecommitdiff
path: root/templates/interfaces/tunnel/node.def
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/tunnel/node.def')
-rw-r--r--templates/interfaces/tunnel/node.def17
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def
index 7490f336..cc99c1f5 100644
--- a/templates/interfaces/tunnel/node.def
+++ b/templates/interfaces/tunnel/node.def
@@ -10,6 +10,23 @@ commit:expression: $VAR(./local-ip/) != "" ; \
"Must configure the tunnel local-ip for $VAR(@)"
commit:expression: $VAR(./encapsulation/) != "" ; \
"Must configure the tunnel encapsulation for $VAR(@)"
+commit:expression:
+exec "
+ if [ $VAR(./encapsulation/@) == gre-multipoint ] && [ -n \"$VAR(./remote-ip/)\" ]; then \
+ echo \"Remote-ip shouldn't be set for mGRE mode for $VAR(@)\"; \
+ exit 1; \
+ fi; \
+ if [ $VAR(./encapsulation/@) != gre-multipoint ] && [ ! -n \"$VAR(./remote-ip/)\" ]; then \
+ echo \"Must configure the tunnel remote-ip for $VAR(@)\"; \
+ exit 1; \
+ fi;
+
+ exit 0"
+commit:expression: (!(pattern $VAR(./local-ip/@) ".*:.*") && $VAR(./encapsulation/@) == "gre-multipoint") || \
+ $VAR(./encapsulation/@) != "gre-multipoint"; "IPv6 local-ip ($VAR(./local-ip/@)) is forbidden for gre-multipoint encapsulation type."
+
+commit:expression: (!(pattern $VAR(./address/@@) ".*:.*") && $VAR(./encapsulation/@) == "gre-multipoint") || \
+ $VAR(./encapsulation/@) != "gre-multipoint"; "IPv6 addresses ($VAR(./address/@@)) are forbidden for gre-multipoint encapsulation type."
create:
if [ "$VAR(./encapsulation/@)" == "gre-multipoint" ]; then