diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-30 10:47:51 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-30 10:47:51 -0800 |
commit | 535038b0a269f19c58ed1be3b4aafba66877ae2e (patch) | |
tree | 4d89551615d3678e30aaa65569195090bf59d9b4 /templates/interfaces/bridge | |
parent | d9183649e3a5a297c816c4c0ecf8f5250964656f (diff) | |
download | vyatta-cfg-system-535038b0a269f19c58ed1be3b4aafba66877ae2e.tar.gz vyatta-cfg-system-535038b0a269f19c58ed1be3b4aafba66877ae2e.zip |
Add dhcpv6 options for all interfaces that support DHCP
DHCPv6 is not restricted to ethernet only anymore.
Diffstat (limited to 'templates/interfaces/bridge')
4 files changed, 56 insertions, 1 deletions
diff --git a/templates/interfaces/bridge/node.tag/address/node.def b/templates/interfaces/bridge/node.tag/address/node.def index 45aa03e2..ab0e5593 100644 --- a/templates/interfaces/bridge/node.tag/address/node.def +++ b/templates/interfaces/bridge/node.tag/address/node.def @@ -9,8 +9,8 @@ create: sudo /opt/vyatta/sbin/vyatta-address add $VAR(../@) $VAR(@) delete: sudo /opt/vyatta/sbin/vyatta-address delete $VAR(../@) $VAR(@) - allowed: echo "dhcp <>" val_help: ipv4net; IP address and prefix length val_help: ipv6net; IPv6 address and prefix length val_help: dhcp; Dynamic Host Configuration Protocol +val_help: dhcpv6; Dynamic Host Configuration Protocol for IPv6 diff --git a/templates/interfaces/bridge/node.tag/dhcpv6-options/node.def b/templates/interfaces/bridge/node.tag/dhcpv6-options/node.def new file mode 100644 index 00000000..d9c814ee --- /dev/null +++ b/templates/interfaces/bridge/node.tag/dhcpv6-options/node.def @@ -0,0 +1,49 @@ +# This node is run before the rest of the interface is configured. +# We first check to see if DHCPv6 is still configured on the interface by +# looking over at the interface address parameters. Then we check to see +# if the DHCPv6 client program is still running on this interface. If both +# of those are true, then any change to this tree means that the user +# has changed this tree ONLY, and that we are going to have to re-start +# the DHCPv6 client using the new parameters. + + +priority: 317 # Run before interface has been configured + +help: DHCPv6 options + +end: + ifname="$VAR(../@)" + echo "dhcpv6-options: ifname is $ifname" + + dhcpv6_set=0 + for param in $VAR(../address/@@); do + if [ "$param" = "dhcpv6" ]; then + dhcpv6_set=1 + fi + done + + if [ $dhcpv6_set -eq 0 ]; then + echo "DHCPv6 is not configured on this interface" + exit 0 + fi + + conffile=/var/lib/dhcp3/dhclient_v6_$VAR(../@).conf + if [ ! -e $conffile ]; then + echo "Conf file $conffile doesn't exist" + exit 0 + fi + + if [ -n "$VAR(./parameters-only)" ]; then + arg1="--parameters-only" + fi + + if [ -n "$VAR(./temporary)" ]; then + arg2="--temporary" + fi + + echo "Re-starting DHCPv6 client on ${ifname}..." + sudo /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --stop --start \ + --ifname $ifname $arg1 $arg2 + + echo "Done." + exit 0 diff --git a/templates/interfaces/bridge/node.tag/dhcpv6-options/parameters-only/node.def b/templates/interfaces/bridge/node.tag/dhcpv6-options/parameters-only/node.def new file mode 100644 index 00000000..0e407f81 --- /dev/null +++ b/templates/interfaces/bridge/node.tag/dhcpv6-options/parameters-only/node.def @@ -0,0 +1,3 @@ + +help: Acquire only config parameters, not address + diff --git a/templates/interfaces/bridge/node.tag/dhcpv6-options/temporary/node.def b/templates/interfaces/bridge/node.tag/dhcpv6-options/temporary/node.def new file mode 100644 index 00000000..a850ef4b --- /dev/null +++ b/templates/interfaces/bridge/node.tag/dhcpv6-options/temporary/node.def @@ -0,0 +1,3 @@ + +help: IPv6 "temporary" address + |