summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-05-17 20:42:03 +0200
committerChristian Poessinger <christian@poessinger.com>2020-05-17 20:42:03 +0200
commitdd6d46f7a60fcc196172e8a7278d7f91e9a63dda (patch)
tree1eb17f8aaed85cae44f859bbca68ace5d913a302 /data
parentca2f7e5e62efa163843b45a4f89c1e66d40a9a4a (diff)
parent8f1fd7ce8e9202a20913fe2f9c701af7a0b9fc72 (diff)
downloadvyos-1x-dd6d46f7a60fcc196172e8a7278d7f91e9a63dda.tar.gz
vyos-1x-dd6d46f7a60fcc196172e8a7278d7f91e9a63dda.zip
Merge branch 'ipv6-pd' of github.com:c-po/vyos-1x into current
* 'ipv6-pd' of github.com:c-po/vyos-1x: pppoe: dhcpv6-pd: T421: change system type to forking pppoe: dhcpv6-pd: T421: stop service when config is removed pppoe: dhcpv6-pd: T421: start/stop delegation with interface status pppoe: dhcpv6-pd: T421: initial support dhcpv6-pd: T421: migrate from ISC dhclient to wide-dhcpv6-client
Diffstat (limited to 'data')
-rw-r--r--data/templates/dhcp-client/ipv6.tmpl43
-rw-r--r--data/templates/pppoe/ip-down.script.tmpl5
-rw-r--r--data/templates/pppoe/ipv6-up.script.tmpl5
3 files changed, 50 insertions, 3 deletions
diff --git a/data/templates/dhcp-client/ipv6.tmpl b/data/templates/dhcp-client/ipv6.tmpl
index be0235add..6cfe24d3e 100644
--- a/data/templates/dhcp-client/ipv6.tmpl
+++ b/data/templates/dhcp-client/ipv6.tmpl
@@ -1,4 +1,41 @@
# generated by dhcp.py
-interface "{{ ifname }}" {
- request routers, domain-name-servers, domain-name;
-}
+# man https://www.unix.com/man-page/debian/5/dhcp6c.conf/
+
+interface {{ ifname }} {
+ request domain-name-servers;
+ request domain-name;
+{% if dhcpv6_prm_only %}
+ information-only;
+{% endif %}
+{% if not dhcpv6_temporary %}
+ send ia-na 1; # non-temporary address
+{% endif %}
+{% if dhcpv6_pd %}
+ send ia-pd 2; # prefix delegation
+{% endif %}
+};
+
+{% if not dhcpv6_temporary %}
+id-assoc na 1 {
+ # Identity association NA
+};
+{% endif %}
+
+{% if dhcpv6_pd %}
+id-assoc pd 2 {
+{% for intf in dhcpv6_pd %}
+ prefix-interface {{ intf.ifname }} {
+{% if intf.sla_id %}
+ sla-id {{ intf.sla_id }};
+{% endif %}
+{% if intf.sla_len %}
+ sla-len {{ intf.sla_len }};
+{% endif %}
+{% if intf.if_id %}
+ ifid {{ intf.if_id }};
+{% endif %}
+ };
+{% endfor %}
+};
+{% endif %}
+
diff --git a/data/templates/pppoe/ip-down.script.tmpl b/data/templates/pppoe/ip-down.script.tmpl
index a68fc099c..fe8fd7584 100644
--- a/data/templates/pppoe/ip-down.script.tmpl
+++ b/data/templates/pppoe/ip-down.script.tmpl
@@ -26,3 +26,8 @@ fi
# Always delete default route when interface goes down
vtysh -c "conf t" ${VRF_NAME} -c "no ip route 0.0.0.0/0 {{ intf }} ${VRF_NAME}"
{% endif %}
+
+{% if dhcpv6_pd %}
+# Start wide dhcpv6 client
+systemctl stop dhcp6c@{{ intf }}.service
+{% endif %}
diff --git a/data/templates/pppoe/ipv6-up.script.tmpl b/data/templates/pppoe/ipv6-up.script.tmpl
index a4b08ddaf..90873229a 100644
--- a/data/templates/pppoe/ipv6-up.script.tmpl
+++ b/data/templates/pppoe/ipv6-up.script.tmpl
@@ -39,3 +39,8 @@ echo 2 > /proc/sys/net/ipv6/conf/{{ intf }}/accept_ra
# Autoconfigure addresses using Prefix Information in Router Advertisements.
echo 1 > /proc/sys/net/ipv6/conf/{{ intf }}/autoconfigure
{% endif %}
+
+{% if dhcpv6_pd %}
+# Start wide dhcpv6 client
+systemctl start dhcp6c@{{ intf }}.service
+{% endif %}