From 0dcde1edee1b6c84feb7a4dc0b690909a7b5d498 Mon Sep 17 00:00:00 2001 From: Carl Byington Date: Mon, 4 May 2015 15:54:41 -0700 Subject: allow dhcp interface for the local end of a tunnel Signed-off-by: Daniil Baturin --- .../interfaces/tunnel/node.tag/dhcp-interface/node.def | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 templates/interfaces/tunnel/node.tag/dhcp-interface/node.def (limited to 'templates') 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 -- cgit v1.2.3