this question How do I add an additional IP address to /etc/network/interfaces? mostly asks what i want except that i want to add more IPv6 addresses in the same interface eth0 without incrementing to eth0.1 and so on. the ifconfig command does IPv6 like ifconfig eth0 add ... so ... how can i add more IPv6 addresses to eth0?


4 Answers 4


It would appear (tested with ifupdown version that we can add several iface eth0 inet6 stanzas to the interfaces file, which is more declarative than the accepted answer. The following code instructs the ifupdown suite to use stateless autoconfiguration and two additional static IPv6 addresses for the eth0 network interface:

iface eth0 inet6 auto
iface eth0 inet6 static
  address 3ffe:ffff::dead:beef
  netmask 32
iface eth0 inet6 static
  address 3ffe:ffff::c0de:d00d
  netmask 32
  • 5
    This is the "proper" answer - for IPv6 and IPv4! Jul 7, 2016 at 20:50
  • in my case your answer did not work, but the approved one above did work. I am not sure why it might since it is a virtual machine (xen)?
    – Sverre
    Feb 1, 2018 at 13:43
  • It would be useful to know what version of ifupdown you use. Can you look into the manpage of ifconfig?
    – Witiko
    Feb 1, 2018 at 14:31
  • 1
    While this works, it may not do what you want with respect to private addressing and router advertisements. See salsa.debian.org/debian/ifupdown/blob/master/inet6.defn for what actually happens. It seems like the order matters here for each of the inet6 statements. It may make sense to have a single auto declaration and then use post-up to add the addresses via ip -6 add and pre-down to remove it.
    – AngerClown
    Jan 14, 2020 at 2:26
  • 2
    Props for the dead:beef and c0de:d00d. Aug 25, 2021 at 7:38

In the question you reference, the second answer shows the equivalent solution for IPv4. In the case of IPv6, the /etc/network/interfaces file should contain something like this:

iface eth0 inet6 static
  address 2001:db8:1:2::2
  netmask 64
  # Add additional IPv6 addresses when $IFACE goes up
  up ip -6 addr add 2001:db8:1:2::3/64 dev $IFACE
  up ip -6 addr add 2001:db8:1:2::4/64 dev $IFACE
  # Remove them when $IFACE goes down
  down ip -6 addr del 2001:db8:1:2::3/64 dev $IFACE
  down ip -6 addr del 2001:db8:1:2::4/64 dev $IFACE

You will need the iproute2 package installed, but you should use ip instead of ifconfig anyway.

For adding a whole /64 to an interface: There are some Q&As in serverfault.se, like "Adding a whole IPv6 /64 block to an network interface on debian" or "Can I bind a (large) block of addresses to an interface?". Maybe they can help you.

  • that local block route feature works so all i need to do now is get that added so it puts it back on reboot
    – Skaperen
    May 6, 2015 at 9:25

Here is what I did for multiple v6 addresses in interfaces file. First thing to consider is there cannot be two gateways, so you add a route below the second address.

iface ens802f0 inet6 static
    address 1154::1154
    netmask 64
    gateway 1154::130

iface ens802f0 inet6 static
     address 1063::105
     netmask 64
     up ip -6 route add 1063::/64 via 1063::254 || true

I was puzzled, too. But you can just give as many address lines you like. And it works.


iface eth0 inet6 static
  address fd12:3456:789a::dead:beef/64
  address fd12:3456:789a::c0de:d00d/64
  # add more address lines here
  gateway fe80::1

Apply without interruption with:

ifup eth0

You can also remove addresses this way. No need for ifdown.


# dpkg -l ifupdown | cat
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
rc  ifupdown       0.8.36       amd64        high level tools to configure network interfaces

# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm


You can even use IPv4 addresses to improve readability. For example on ProxMox I map the IPv6 of a VM based on the internal IPv4 of the VM, which gives addresses like:

fd01:7e57:: provided your IPv6 prefix is /64.

fd12:3456:789a in the example above is from the private IPv6 area fd00::/8, which is similar to a private net on IPv4 like Replace 12:3456:789a with 40 random bits. This leaves 16 bits for subnets to form a /64 (in IPv6, networks cannot go beyond /64, so this should always be the biggest address mask you can see on properly IPv6 enabled networks).

RIPE even writes:

Assigning prefixes longer than /56 is strongly discouraged, so your choices are: If you want a simple addressing plan use a /48 for each end-user


  • "Official" (static) allocations from your ISP should give you a /48.
  • Dynamic allocations (from the ISP to your router), usually give you a /56.
  • And internally on our network, you use a /64, so you can split up the /56 into 256 distinct networks for your own needs.

If you see a /64 on your router this does not mean, your ISP is nuts. Many routers default to /64 if not configured otherwise. Usually all ISPs allow routers to request a /56.

So on the other side (Server) you can safely assume, that all IPs which use the same prefix according to /56 come from the same network.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .