summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet119
1 files changed, 17 insertions, 2 deletions
diff --git a/rc.inet1 b/rc.inet1
index a9ae95b..7de9920 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -329,6 +329,18 @@ if_up() {
IF_UP=0
if [ -e /proc/sys/net/ipv6 ] && [ "${USE_DHCP6[$i]}" != "yes" ] && [ "${USE_SLAAC[$i]}" = "yes" ]; then # configure via SLAAC
info_log "${1}: enabling SLAAC"
+ if [ "${SLAAC_PRIVIPGEN[$i]}" = "yes" ]; then
+ if [ -n "${SLAAC_SECRET[$i]}" ]; then
+ echo "${SLAAC_SECRET[$i]}" >/proc/sys/net/ipv6/conf/${1}/stable_secret
+ echo "2" >/proc/sys/net/ipv6/conf/${1}/addr_gen_mode
+ else
+ echo -n >/proc/sys/net/ipv6/conf/${1}/stable_secret
+ echo "3" >/proc/sys/net/ipv6/conf/${1}/addr_gen_mode
+ fi
+ fi
+ if [ "${SLAAC_TEMPADDR[$i]}" = "yes" ]; then
+ echo "2" >/proc/sys/net/ipv6/conf/${1}/use_tempaddr
+ fi
# Enable accepting of RA packets, unless explicitly configured not to:
if [ "${USE_RA[$i]}" = "no" ]; then
debug_log "${1}: ignoring IPv6 RA"
@@ -549,11 +561,14 @@ if_down() {
# Bring the interface down:
debug_log "/sbin/ip link set dev ${1} down"
/sbin/ip link set dev ${1} down
- # Reset autoconf and accept_ra back to defaults:
+ # Reset everything back to defaults:
if [ -e /proc/sys/net/ipv6 ]; then
- debug_log "${1}: resetting IPv6 autoconf and RA to defaults"
+ debug_log "${1}: resetting IPv6 configuration to defaults"
cat /proc/sys/net/ipv6/conf/default/autoconf >/proc/sys/net/ipv6/conf/${1}/autoconf
cat /proc/sys/net/ipv6/conf/default/accept_ra >/proc/sys/net/ipv6/conf/${1}/accept_ra
+ cat /proc/sys/net/ipv6/conf/defailt/use_tempaddr >/proc/sys/net/ipv6/conf/${1}/use_tempaddr
+ cat /proc/sys/net/ipv6/conf/default/addr_gen_mode >/proc/sys/net/ipv6/conf/${1}/addr_gen_mode
+ echo -n >/proc/sys/net/ipv6/conf/${1}/stable_secret
fi
# If the interface is a bridge, then destroy it now:
[ -n "${BRNICS[$i]}" ] && br_close $i