bundles/wide-dhcp6c: introduce, add to home.router
This commit is contained in:
parent
6b4eae842b
commit
fa224a9939
7 changed files with 132 additions and 0 deletions
17
bundles/wide-dhcp6c/files/dhcp6c.conf
Normal file
17
bundles/wide-dhcp6c/files/dhcp6c.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
interface ${source} {
|
||||
send ia-pd 0;
|
||||
};
|
||||
|
||||
id-assoc pd 0 {
|
||||
% for iface, subnet_id in sorted(targets.items()):
|
||||
prefix-interface ${iface} {
|
||||
sla-len ${subnet_len};
|
||||
sla-id ${subnet_id};
|
||||
ifid ${subnet_id};
|
||||
};
|
||||
% endfor
|
||||
};
|
||||
|
||||
profile default {
|
||||
information-only;
|
||||
};
|
10
bundles/wide-dhcp6c/files/ip-down
Normal file
10
bundles/wide-dhcp6c/files/ip-down
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
systemctl stop wide-dhcpv6-client
|
||||
|
||||
% for interface, subnet_id in sorted(targets.items()):
|
||||
for IP in $(ip -6 addr show dev ${interface} | grep inet6 | awk '{print $2}' | grep -vF 'fe80::')
|
||||
do
|
||||
ip -6 addr del $IP dev ${interface}
|
||||
done
|
||||
% endfor
|
11
bundles/wide-dhcp6c/files/ip-up
Normal file
11
bundles/wide-dhcp6c/files/ip-up
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
INTERFACE=$1
|
||||
|
||||
if [[ "$INTERFACE" != "${source}" ]]
|
||||
then
|
||||
echo "wide-dhcp6c is not configured to work on $INTERFACE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
systemctl start wide-dhcpv6-client
|
10
bundles/wide-dhcp6c/files/wide-dhcpv6-client.service
Normal file
10
bundles/wide-dhcp6c/files/wide-dhcpv6-client.service
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=WIDE-DHCPv6-Client
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
PIDFile=/run/dhcp6c.pid
|
||||
ExecStart=/usr/sbin/dhcp6c -c /etc/wide-dhcpv6/dhcp6c.conf -p /run/dhcp6c.pid -f ${source}
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
Loading…
Add table
Add a link
Reference in a new issue