DHCPv6 Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
trendy
Posts: 125
Joined: Tue Feb 25, 2020 2:54 pm

DHCPv6

Post by trendy »

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:

Code: Select all

dietpi@odroid:[~]$ ps auxw | grep dhcp
root       534  0.0  0.2   6236  2260 ?        Ss   Φεβ23   0:00 /sbin/dhclient -4 -v -i -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases -I -df /var/lib/dhcp/dhclient6.eth0.leases eth0
root      1180  0.0  0.2   6236  2284 ?        Ss   Φεβ23   0:00 /sbin/dhclient -6 -v -i -pf /run/dhclient6.eth0.pid -lf /var/lib/dhcp/dhclient6.eth0.leases -I -df /var/lib/dhcp/dhclient6.eth0.leases eth0
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!
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: DHCPv6

Post by Joulinar »

Hi,

I would recommend to use dietpi-config tool to make changes on your network interfaces. There you can set a STATIC IP.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
trendy
Posts: 125
Joined: Tue Feb 25, 2020 2:54 pm

Re: DHCPv6

Post by trendy »

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?

Code: Select all

               ●─ 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.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: DHCPv6

Post by Joulinar »

Than we misunderstood.

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.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
trendy
Posts: 125
Joined: Tue Feb 25, 2020 2:54 pm

Re: DHCPv6

Post by trendy »

Joulinar wrote: Tue Feb 25, 2020 11:50 pm Than we misunderstood.

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.
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.
Joulinar wrote: Tue Feb 25, 2020 11:50 pm Is there a reason to use IPv6 on a local network? usually IPv4 should be fine for privat use.
Because I am using IPv6 in all my devices and I have delegated prefix from my ISP.
trendy
Posts: 125
Joined: Tue Feb 25, 2020 2:54 pm

Re: DHCPv6

Post by trendy »

Adding

Code: Select all

iface eth0 inet6 dhcp
in

Code: Select all

/etc/network/interfaces
does the work.
So I guess by adding a line

Code: Select all

iface eth$ETH_DEV_INDEX inet6 $eth_dhcp_static_text
in position 2396 (and in 2404 for wifi "iface wlan$WIFI_DEV_INDEX inet $wifi_dhcp_static_text" ) in

Code: Select all

/boot/dietpi/dietpi-config
under Network_ApplyChanges() function will make the change permanent for the future.
trendy
Posts: 125
Joined: Tue Feb 25, 2020 2:54 pm

Re: DHCPv6

Post by trendy »

Can it be added in the next version?
I don't think it hurts to have DHCP6 as well and not just SLAAC.
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: DHCPv6

Post by MichaIng »

Yes full IPv6 support, including DHCPv6, is planned: https://github.com/MichaIng/DietPi/projects/1
Will be the first thing I start working on after v6.29 release.
trendy
Posts: 125
Joined: Tue Feb 25, 2020 2:54 pm

Re: DHCPv6

Post by trendy »

Splendid! Thank you Michal!
Post Reply