Hello!
Since I am using the dietpi devices as servers I needed a static IP, but I failed miserably to configure it in /etc/network/interfaces or interfaces.d
Hence I tried my luck with dhcp6 and it seems to work fine:
Also notice that the dhcp client for ipv4 is using dhclient6.eth0.leases, not sure if this was accidental or intended.
The main question is how can I make this change permanent so it doesn’t get overwritten in some future upgrade?
Is it possible to include it in a future release as well as an option?
Thank you!
It is not obvious how to input the IPv6 addresses/mask/gateway/nameservers.
Am I supposed to input the ipv6 address after the ipv4, separated with space or comma?
●─ DHCP/STATIC IP ──────────────────────●
Change Mode : [STATIC]
Copy : Copy current address to "Static"
Static Ip : [10.0.2.2 fd00:bbbb::2]
Static Mask : [255.255.255.0 64]
Static Gateway : [10.0.2.1 fd00:bbbb::1]
Static DNS : [127.0.0.1 ::1]
●─ Additional Options ──────────────────●
Just to be clear. IPv6 is enabled and works fine with SLAAC. What I want is to have dhcp6 client or to be able to set static IP.
Within the dietpi-config, STATIC IP address configuration you could specify for IPv4 addresses only. IPv6, you just simply need to activate.
Using SLAAC, the IPv6 network listens for a Router Advertisement (RA) from the host and then assigns a 64-bit prefix. The last 64 bits of the address are derived in a process in which the host device essentially self-determines its address. so it’s nearly static as the host is creating it’s own address.
Is there a reason to use IPv6 on a local network? usually IPv4 should be fine for privat use.
The only thing that activates Dietpi is SLAAC and I mentioned that SLAAC is working fine. But this is not my question.
If there is no easy way to apply a static IPv6, I can live with DHCPv6. It works with the command I provided in the first post. I want to know if this can be enabled somehow in Dietpi or where to place it so it doesn’t get overwritten and to start when the interface goes down/up.
Because I am using IPv6 in all my devices and I have delegated prefix from my ISP.
Thanks for the intervention.
I remember I incorporated the changes here and it worked fine. I am not sure if in the meantime it became mainstream from @MichaIng .
If you are a power user then DietPi is maybe not the right choice for you. DietPi tries to keep things simple, most of the useres probably don’t even use IPv6 and if they use, also only a small subset needs DHCPv6, most are fine with SLAAC and RA.
So if you know how to do it in Debian (or RPi OS) you can also do it the same way on DietPi. It’s not removed, the script just don’t care about. But feel free to edit /etc/network/interfaces to your likings and add a config for dhcp6.
If it’s so simple feel free to contribute on GitHub, even when you just extend the docs for the simple part of how to use IPv6 with DHCPv6
Although I think that in 2024 we should not be discussing if IPv6 is used or not, if it is for advanced users etc.
It is a minor thing to add a config file.
Especially as power user, one should not have any issues adding a custom config file or edit one, which can be done on DietPi like on any other Debian or Debian-based system .
But yeah, better use a drop-in config like trendy suggested, so even when using dietpi-config to change network settings, it will survive.
DHCPv6 is a very rare think that is usually not required thanks to SLAAC. IPv6 is generally enabled via SLAAC OOTB on DietPi, as long as the local network supports it. The question is @tr1p0p whether you really need DHCPv6 to setup IPv6 addresses in you LAN. I can imagine use cases, but I can’t remember ever facing one.
Static IPv6 addresses generally cannot work, since they naturally need to have the public IPv6 prefix, which is given by your ISP and are hence not chosen.