# DHCPv6

**URL:** https://dietpi.com/forum/t/dhcpv6/3885
**Category:** General Discussion
**Created:** [25 February 2020 14:00 UTC](https://dietpi.com/forum/t/dhcpv6/3885 "2020-02-25T14:00:44Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [25 February 2020 14:00 UTC](https://dietpi.com/forum/t/dhcpv6/3885/1 "2020-02-25T14:00:44Z")

</div>

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:

```nohighlight
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 dhclient **6**.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!

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [25 February 2020 14:23 UTC](https://dietpi.com/forum/t/dhcpv6/3885/2 "2020-02-25T14:23:04Z")

</div>

Hi,

I would recommend to use dietpi-config tool to make changes on your network interfaces. There you can set a STATIC IP.

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [25 February 2020 14:30 UTC](https://dietpi.com/forum/t/dhcpv6/3885/3 "2020-02-25T14:30:33Z")

</div>

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?

```nohighlight
               ●─ 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.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [25 February 2020 22:50 UTC](https://dietpi.com/forum/t/dhcpv6/3885/4 "2020-02-25T22:50:45Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [26 February 2020 09:48 UTC](https://dietpi.com/forum/t/dhcpv6/3885/5 "2020-02-26T09:48:23Z")

</div>

> [@](#):
>
> 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.

> [@](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [27 February 2020 13:11 UTC](https://dietpi.com/forum/t/dhcpv6/3885/6 "2020-02-27T13:11:23Z")

</div>

Adding

```nohighlight
iface eth0 inet6 dhcp

```

in

```nohighlight
/etc/network/interfaces

```

does the work.  
So I guess by adding a line

```nohighlight
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

```nohighlight
/boot/dietpi/dietpi-config

```

under **Network\_ApplyChanges()** function will make the change permanent for the future.

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [1 March 2020 21:18 UTC](https://dietpi.com/forum/t/dhcpv6/3885/7 "2020-03-01T21:18:20Z")

</div>

Can it be added in the next version?  
I don’t think it hurts to have DHCP6 as well and not just SLAAC.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [2 April 2020 11:07 UTC](https://dietpi.com/forum/t/dhcpv6/3885/8 "2020-04-02T11:07:41Z")

</div>

Yes full IPv6 support, including DHCPv6, is planned: [https://github.com/MichaIng/DietPi/projects/1](https://github.com/MichaIng/DietPi/projects/1)  
Will be the first thing I start working on after v6.29 release.

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [2 April 2020 12:12 UTC](https://dietpi.com/forum/t/dhcpv6/3885/9 "2020-04-02T12:12:42Z")

</div>

Splendid! Thank you Michal!

---

<div class="post-metadata">

### Author: ![DietCH](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@DietCH](https://dietpi.com/forum/u/DietCH)
#### Post date: [28 December 2022 14:13 UTC](https://dietpi.com/forum/t/dhcpv6/3885/10 "2022-12-28T14:13:38Z")

</div>

> [@trendy](#):
>
> 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.

I know this is a very old topic, but just in case someone has the same problem, I found the solution on the [debian website.](https://wiki.debian.org/NetworkConfiguration)

It states that you need to modify your /etc/network/interfaces file and add something like this:

```auto
    iface eth0 inet6 static
        address 2001:db8::c0ca:1eaf/64
        gateway 2001:db8::1ead:ed:beef

```

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [28 December 2022 19:57 UTC](https://dietpi.com/forum/t/dhcpv6/3885/11 "2022-12-28T19:57:36Z")

</div>

Thanks for the intervention. 🙂  
I remember I incorporated the changes [here](https://dietpi.com/forum/t/dhcpv6/3885/6) and it worked fine. I am not sure if in the meantime it became mainstream from @MichaIng .

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [28 December 2022 19:59 UTC](https://dietpi.com/forum/t/dhcpv6/3885/12 "2022-12-28T19:59:33Z")

</div>

nope, static IPv6 is not part of our standard implementation.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [29 December 2022 11:14 UTC](https://dietpi.com/forum/t/dhcpv6/3885/13 "2022-12-29T11:14:19Z")

</div>

> [@DietCH](#):
>
> /etc/network/interfaces

I btw recommend to add custom config blocks via dedicated config files, e.g.

```bash
cat << '_EOF_' > /etc/network/interfaces.d/eth0-ipv6.conf
iface eth0 inet6 static
address 2001:db8::c0ca:1eaf/64
gateway 2001:db8::1ead:ed:beef
_EOF_
ifup --force eth0

```

---

<div class="post-metadata">

### Author: ![tr1p0p](https://dietpi.com/forum/user_avatar/dietpi.com/tr1p0p/32/5814_2.png) [@tr1p0p](https://dietpi.com/forum/u/tr1p0p)
#### Post date: [10 December 2024 12:08 UTC](https://dietpi.com/forum/t/dhcpv6/3885/14 "2024-12-10T12:08:56Z")

</div>

So… It’s still a issue like 2 years after ? Because i **still** don’t have dhcpv6 on my dietpi on the last upate so… Hum… .when ?

Because a simple raspbian have it, so what you do ? You said you just “put scripts” on it but at the end it just… .miss stuffs ?

Why remove DHCPv6 on default installation on a os that for… network stuffs ?

I don’t understand. Also : having a simple doc to just… activate DHCPv6 is possible, too ?

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [10 December 2024 18:06 UTC](https://dietpi.com/forum/t/dhcpv6/3885/15 "2024-12-10T18:06:27Z")

</div>

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 🙂

---

<div class="post-metadata">

### Author: ![trendy](https://dietpi.com/forum/user_avatar/dietpi.com/trendy/32/61_2.png) [@trendy](https://dietpi.com/forum/u/trendy)
#### Post date: [17 December 2024 19:17 UTC](https://dietpi.com/forum/t/dhcpv6/3885/16 "2024-12-17T19:17:09Z")

</div>

To get the address from DHCP6

```auto
cat << EOF > /etc/network/interfaces.d/ipv6.conf
iface eth0 inet6 dhcp
        autoconf 1
        accept_ra 2
EOF

```

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.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [17 December 2024 19:29 UTC](https://dietpi.com/forum/t/dhcpv6/3885/17 "2024-12-17T19:29:11Z")

</div>

Ping @MichaIng

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [20 December 2024 05:34 UTC](https://dietpi.com/forum/t/dhcpv6/3885/18 "2024-12-20T05:34:17Z")

</div>

> [@Jappe](#):
>
> If you are a power user then DietPi is maybe not the right choice for you.

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.
