summaryrefslogtreecommitdiff
path: root/templates/interfaces/tunnel
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/tunnel')
-rw-r--r--templates/interfaces/tunnel/node.def9
-rw-r--r--templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def10
2 files changed, 16 insertions, 3 deletions
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def
index 720bf64f..bd2c4255 100644
--- a/templates/interfaces/tunnel/node.def
+++ b/templates/interfaces/tunnel/node.def
@@ -57,14 +57,17 @@ create:
else
TTL="ttl 255"
fi
- if [ -n "$VAR(./parameters/ip/key/@)" ]; then
+ if [ -n "$VAR(./parameters/ip/key/@)" ]; then
KEY="key $VAR(./parameters/ip/key/@)"
- fi
+ fi
if [ "$VAR(./encapsulation/@)" == "gre" ] && [ -z $VAR(./remote-ip/) ]; then
ip tunnel add $VAR(@) local $LIP mode gre $KEY $TTL $TOS
elif [ "$VAR(./encapsulation/@)" == "sit" ] && [ -n "$VAR(./6rd-prefix/@)" ]; then
+ if [ -n "$VAR(./6rd-relay-prefix/@)" ]; then
+ RP="6rd-relay_prefix $VAR(./6rd-relay-prefix/@)"
+ fi
ip tunnel add $VAR(@) remote $VAR(./remote-ip/@) mode sit
- ip tunnel 6rd dev $VAR(@) 6rd-prefix $VAR(./6rd-prefix/@)
+ ip tunnel 6rd dev $VAR(@) 6rd-prefix $VAR(./6rd-prefix/@) $RP
else
ip tunnel add $VAR(@) local $LIP remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY $TTL $TOS
fi
diff --git a/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def b/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def
new file mode 100644
index 00000000..0f877e2d
--- /dev/null
+++ b/templates/interfaces/tunnel/node.tag/6rd-relay-prefix/node.def
@@ -0,0 +1,10 @@
+multi:
+type: ipv4net
+val_help: ipv4net; IPv4 prefix of interface for 6rd
+help: 6rd relay prefix
+
+syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)"
+
+create:expression: "true"
+update:expression: "false" ; \
+ "6rd-relay-prefix can only be modified at tunnel creation for $VAR(../@)"