dhcpcd icon indicating copy to clipboard operation
dhcpcd copied to clipboard

slaac ... temporary usage

Open biloute02 opened this issue 1 year ago • 1 comments

Hello,

I don't understand the usage of the directive temporary in /etc/dhcpcd.conf:

slaac private
slaac private temp

My testing workflow was:

sysctl net.ipv6.conf.eth0.use_tempaddr=1
ip link set dev eth0 down && ip link set dev eth0 up
vim /etc/dhcpcd.conf
dhcpc --rebind eth0
ip -6 a show dev eth0

Initially, the kernel parameter use_tempaddr=0. I get the same ip addresses with or without temp:

# grep "^slaac" /etc/dhcpcd.conf
slaac private
# dhcpc --rebind eth0
sending commands to dhcpcd process
# ip -6 a show dev eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet6 --public_stable--:31d7/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 86379sec preferred_lft 86379sec
    inet6 --local--:bedb/64 scope link
       valid_lft forever preferred_lft forever
# grep "^slaac" /etc/dhcpcd.conf
slaac private temp
# dhcpc --rebind eth0
sending commands to dhcpcd process
# ip -6 a show dev eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet6 --public_stable--:31d7/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 86385sec preferred_lft 86385sec
    inet6 --local--:bedb/64 scope link
       valid_lft forever preferred_lft forever

Then I set the kernel parameter use_tempaddr=1. I get temporary addresses, but changing temp does nothing etiher:

# grep "^slaac" /etc/dhcpcd.conf
slaac private
# dhcpc --rebind eth0
sending commands to dhcpcd process
# ip -6 a show dev eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet6 --temp1--:3c8c/64 scope global temporary dynamic
       valid_lft 86399sec preferred_lft 85884sec
    inet6 --public_stable--:31d7/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 86399sec preferred_lft 86399sec
    inet6 --local--:bedb/64 scope link
       valid_lft forever preferred_lft forever
# grep "^slaac" /etc/dhcpcd.conf
slaac private temp
# dhcpc --rebind eth0
sending commands to dhcpcd process
# ip -6 a show dev eth0
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet6 --temp2--:2117/64 scope global temporary dynamic
       valid_lft 86394sec preferred_lft 85871sec
    inet6 --public_stable--:31d7/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 86394sec preferred_lft 86394sec
    inet6 --temp1--:3c8c/64 scope global temporary dynamic
       valid_lft 86233sec preferred_lft 85718sec
    inet6 --local--:bedb/64 scope link
       valid_lft forever preferred_lft forever

Is the temp directive only working on certain conditions (Linux kernel version)?

Does, under normal operating conditions, the temp directive replace the kernel setting use_tempaddr and a temporary address is created even if it set to 0?

Or temp is used internally by dhcpcd (e.g. to know that temporay addresses are being used) but effectively does nothing?

I have read the dhcpcd.conf manual but could not find any information on this.

My system is Void Linux:

$ uname -a
Linux berry 6.6.42_1 #1 SMP PREEMPT Sat Jul 27 03:30:00 UTC 2024 aarch64 GNU/Linux

Thank you for your time

biloute02 avatar Dec 01 '24 15:12 biloute02

I'm wondering the same thing, temp seems to not do anything.

ii8 avatar Mar 16 '25 22:03 ii8