在ubuntu中设置静态ipv6地址

Szt*_*upY 2 ubuntu ipv6

我正在尝试向已经存在的接口添加一个 ipv6 地址,该接口以前只有 ipv4。这是我的配置:

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
Run Code Online (Sandbox Code Playgroud)

但是重新启动接口eth8后仍然只有一个本地链接地址:

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
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

Mik*_*eyB 12

正如彼得所提到的,modprope拼写错误。

这导致脚本不使用该inet6 static部分,因为 pre-up 命令失败。你可以摆脱它 - 不需要它。

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.
Run Code Online (Sandbox Code Playgroud)

除此之外,您的文件是正确的。/120 不是通常的网络掩码,但您大概知道自己在做什么。


Pet*_*ace 9

你拼错了 modprobe,可能是模块没有正确加载?