summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorCarl Byington <carl@five-ten-sg.com>2015-05-04 15:54:41 -0700
committerDaniil Baturin <daniil@baturin.org>2015-06-13 19:01:46 +0200
commit0dcde1edee1b6c84feb7a4dc0b690909a7b5d498 (patch)
tree0d80ab1094a21be43955638f02f02a24e010fb5c /templates
parent593881742424f3499f32cc75d86786e7f948b2a1 (diff)
downloadvyatta-cfg-system-0dcde1edee1b6c84feb7a4dc0b690909a7b5d498.tar.gz
vyatta-cfg-system-0dcde1edee1b6c84feb7a4dc0b690909a7b5d498.zip
allow dhcp interface for the local end of a tunnel
Signed-off-by: Daniil Baturin <daniil@baturin.org>
Diffstat (limited to 'templates')
-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