Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
userdoc:tt-dhcpv6-prefix-delegation [2017/05/11 16:40]
abelbeck [DHCPv6 Client Action Script]
userdoc:tt-dhcpv6-prefix-delegation [2017/06/07 10:19]
abelbeck [DHCPv6 Client Action Script]
Line 27: Line 27:
  
 Internal Interfaces: -> Interface: -> IPv6 Autoconfig:​\\ Internal Interfaces: -> Interface: -> IPv6 Autoconfig:​\\
 +!!Version ->!! AstLinux 1.2.5 to AstLinux 1.2.10 - ''​IPv6/​nn''​ must be empty\\
 {{:​userdoc:​dhcpv6-internal-interface.jpg?​nolink|DHCPv6 Internal Interface}} {{:​userdoc:​dhcpv6-internal-interface.jpg?​nolink|DHCPv6 Internal Interface}}
  
-!!Tip ->​!! ​Any associated static ​IPv6/nn: entry will be ignored if Prefix Delegation is enabledbest practice to leave empty for this case.+!!Version ​->​!! ​AstLinux 1.3.0 and later - ''​IPv6/nn''​ may define a ULA/64 addressor be empty\\ 
 +{{:​userdoc:​ipv6-ula-nptv6-assign-gua.jpg?​nolink|DHCPv6 Internal Interface}}
  
 !!Note ->!! A "​Reboot System"​ is required to apply any changes related to DHCPv6. !!Note ->!! A "​Reboot System"​ is required to apply any changes related to DHCPv6.
- 
 ===== DHCPv6 Client Action Script ===== ===== DHCPv6 Client Action Script =====
  
 !!Note: AstLinux 1.2.10 or later is required!! !!Note: AstLinux 1.2.10 or later is required!!
 +
 +!!Note: AstLinux 1.3.0 or later!! executes a default action, additional custom actions can enabled if a custom script is defined.
  
 If an executable script exists at ''/​mnt/​kd/​dhcp6c.script''​ the dhcp6c daemon will call the script after a DHCPv6 request is processed. If an executable script exists at ''/​mnt/​kd/​dhcp6c.script''​ the dhcp6c daemon will call the script after a DHCPv6 request is processed.
Line 62: Line 65:
  
   dhcp6c_prefix_len   dhcp6c_prefix_len
 +
 +!!Note ->!! Do not expect all the variables to be always defined, though if ''​dhcp6c_prefix''​ is defined then the complete set will be defined.
  
 Lastly, an indication whether the DHCPv6 update was different from the previous update: Lastly, an indication whether the DHCPv6 update was different from the previous update:
Line 67: Line 72:
   dhcp6c_changed   dhcp6c_changed
  
-The ''​dhcp6c_changed''​ can be empty if there was no previous ''​dhcp6c_cache''​ file to compare, ''"​yes"''​ if different from previous, and ''"​no"''​ if the same as previous. ​ The most common use case would be to compare ''​dhcp6c_changed''​ with ''"​no"''​ to skip operations that have been previously performed+The ''​dhcp6c_changed'' ​variable ​can be empty if there was no previous ''​dhcp6c_cache''​ file to compare, ''"​yes"''​ if different from previous, and ''"​no"''​ if the same as previous. ​ The most common use case would be to compare ''​dhcp6c_changed''​ with ''"​no"''​ to skip operations that have been previously performed.
- +
-!!Note ->!! Do not expect all the variables to be always defined, though if ''​dhcp6c_prefix''​ is defined then the complete set will be defined.+
  
-As an example, a simple script to log when the DHCPv6 lease is updated and whether it changed:+As an example, a simple script to log when the DHCPv6 lease is updated and whether it changed:\\ 
 +!!Note ->!! Occurs by default with AstLinux 1.3.0 or later
  
   #!/bin/bash   #!/bin/bash
   ​   ​
   if [ -n "​$dhcp6c_prefix"​ ]; then   if [ -n "​$dhcp6c_prefix"​ ]; then
-    logger -t dhcp6c -p kern.info "Updated with Prefix$dhcp6c_prefix${dhcp6c_changed:​+ ​changed=$dhcp6c_changed}"+    ​case "​$dhcp6c_changed"​ in 
 +      yes) changed="​ (changed)"​ ;; 
 +       no) changed="​ (no change)"​ ;; 
 +        *) changed=""​ ;; 
 +    esac 
 +    ​logger -t dhcp6c -p kern.info "IPv6 Prefix$changed$dhcp6c_prefix"
   fi   fi
 ===== Debugging DHCPv6 ===== ===== Debugging DHCPv6 =====