summaryrefslogtreecommitdiff
path: root/templates/interfaces/tunnel
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/tunnel')
-rw-r--r--templates/interfaces/tunnel/node.tag/dhcp-interface/node.def16
1 files changed, 16 insertions, 0 deletions
diff --git a/templates/interfaces/tunnel/node.tag/dhcp-interface/node.def b/templates/interfaces/tunnel/node.tag/dhcp-interface/node.def
new file mode 100644
index 00000000..60fbae34
--- /dev/null
+++ b/templates/interfaces/tunnel/node.tag/dhcp-interface/node.def
@@ -0,0 +1,16 @@
+type: txt
+help: DHCP interface that supplies the local IP address for this tunnel
+allowed:
+ local -a array ;
+ array=( /var/lib/dhcp3/eth* /var/lib/dhcp3/br* /var/lib/dhcp3/bond* ) ;
+ echo -n ${array[@]##*/}
+create:
+ sudo /opt/vyatta/sbin/vyatta-update-tunnel.pl --interface=$VAR(@) --tunnel=$VAR(../@) --option=create
+ LIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=local)
+ ip tunnel cha $VAR(../@) local $LIP
+update:
+ sudo /opt/vyatta/sbin/vyatta-update-tunnel.pl --interface=$VAR(@) --tunnel=$VAR(../@) --option=create
+ LIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=local)
+ ip tunnel cha $VAR(../@) local $LIP
+delete:
+ sudo /opt/vyatta/sbin/vyatta-update-tunnel.pl --interface=$VAR(@) --tunnel=$VAR(../@) --option=delete