Ubuntu – setting static ipv6 address in ubuntu

ipv6Ubuntu

I'm trying to add an ipv6 address to an already existing interface, which previouosly only had ipv4. This is my config:

auto lo
iface lo inet loopback

auto eth8
iface eth8 inet static
  address 88.**.**.**
  netmask 255.255.255.0
  gateway 88.**.**.**

iface eth8 inet6 static
  pre-up modprope ipv6
  address 2a01:**:**::5
  netmask 120
  gateway 2a01:**:**::7f

but after restarting the interface eth8 still only has a link-local address:

eth8      Link encap:Ethernet  HWaddr 00:15:**:**:**:**
          inet addr:88.**.**.**  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::**:**:**:**/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

what am I doing wrong?

Best Answer

As Peter mentions, the modprope is spelled incorrectly.

This is causing the scripts to not use the inet6 static section as the pre-up command is failing. You can just get rid of it - no need for it.

pre-up command
       Run command before bringing the interface up.  If  this  command
       fails then ifup aborts, refraining from marking the interface as
       configured, prints an error message, and exits  with  status  0.
       This behavior may change in the future.

Other than that your file is correct. /120 is not the usual netmask but presumably you know what you're doing.