summaryrefslogtreecommitdiff
path: root/templates/interfaces/tunnel/node.def
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-03-12 13:28:35 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-03-12 13:28:35 -0700
commit65c3cf595d38d6311b827d2e9b9bc7a1f6720458 (patch)
tree8b7447b22f45133fda8992e968b6dace678a34a6 /templates/interfaces/tunnel/node.def
parent21f2184f8c22207ffb4e686866e0839a73cd310a (diff)
parent23676bb3f69b716eb1d9cb3d34ad2ce0d1686269 (diff)
downloadvyatta-cfg-quagga-65c3cf595d38d6311b827d2e9b9bc7a1f6720458.tar.gz
vyatta-cfg-quagga-65c3cf595d38d6311b827d2e9b9bc7a1f6720458.zip
Merge branch 'glendale' of suva.vyatta.com:/git/vyatta-cfg-system into glendale
Diffstat (limited to 'templates/interfaces/tunnel/node.def')
-rw-r--r--templates/interfaces/tunnel/node.def25
1 files changed, 19 insertions, 6 deletions
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def
index 73c8e572..9ebb581c 100644
--- a/templates/interfaces/tunnel/node.def
+++ b/templates/interfaces/tunnel/node.def
@@ -2,10 +2,23 @@ tag:
type: txt
help: Configure a tunnel interface
syntax:expression: $VAR(@) in "tun0", "tun1", "tun2", "tun3", "tun4", "tun5", "tun6", "tun7", "tun8", "tun9" ; "Must be (tun0 - tun9)"
-commit:expression: $VAR(./local-ip/) != "" ; "Must configure the tunnel local-ip"
-commit:expression: $VAR(./remote-ip/) != "" ; "Must configure the tunnel remote-ip"
-commit:expression: $VAR(./encapsulation/) != "" ; "Must configure the tunnel encapsulation"
-create:expression: "sudo ip tunnel add $VAR(@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@)"
-create:expression: "sudo ip link set $VAR(@) up"
-delete:expression: "sudo ip tunnel del $VAR(@)"
+
+commit:expression: $VAR(./local-ip/) != "" ; \
+ "Must configure the tunnel local-ip for $VAR(@)"
+commit:expression: $VAR(./remote-ip/) != "" ; \
+ "Must configure the tunnel remote-ip for $VAR(@)"
+commit:expression: $VAR(./encapsulation/) != "" ; \
+ "Must configure the tunnel encapsulation for $VAR(@)"
+
+create:expression: "\
+ if [ -n \"$VAR(./key/@)\" ]; then \
+ KEY=\"key $VAR(./key/@)\"; \
+ fi; \
+ sudo ip tunnel add $VAR(@) \
+ local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) \
+ mode $VAR(./encapsulation/@) $KEY; \
+ sudo ip link set $VAR(@) up;" ; "Error creating $VAR(@)"
+
+delete:expression: "sudo ip tunnel del $VAR(@)" ; "Error deleting $VAR(@)"
+
comp_help: "Enter tunnel interface name (tun0 - tun9)"