Ubuntu 14 上的附加靜態 IPv6 位址

Ubuntu 14 上的附加靜態 IPv6 位址

我的 ISP 給了我一個 /64 IPv6 子網,因此我嘗試在 Ubuntu 14.04.3 LTS 中已配置的位址之上新增一個靜態 IPv6 位址。到目前為止,我所有的嘗試都失敗了,我不知道去哪裡尋找資訊。

我透過編輯完成了所有測試

/etc/network/interfaces 

然後發出

/etc/init.d/networking restart

我檢查了新地址

ip -6 addr

ping6 <newAddress>

但它總是無法工作(未顯示/無響應)。

/etc/network/interfaces 的原始內容如下(用遮罩位址為了隱私):

auto lo
iface lo inet loopback

auto  eth0
iface eth0 inet static
  address   85.10.***.***
  netmask   255.255.255.224
  gateway   85.10.***.***
  up route add -net 85.10.***.*** netmask 255.255.255.224 gw 85.10.***.*** eth0

iface eth0 inet6 static
  address 2a01:4f8:***:***::2
  netmask 64
  gateway fe80::1

在嘗試新增 2a01:4f8:xxx:xxx::3 期間,我將以下內容附加到檔案底部(在每個測試中刪除前一個測試新增的內容):

測試1

iface eth0 inet6 static
        address  2a01:4f8:***:***::3
        netmask 64

測試2

up /sbin/ifconfig eth0 inet6 add 2a01:4f8:***:***::3/64

測試3

up ip -6 addr add 2a01:4f8:***:***::3 dev eth0

我在網路和其他答案中找到了它們,但沒有一個起作用。

ping6 2a01:4f8:***:***::3
PING 2a01:4f8:***:***::3(2a01:4f8:***:***::3) 56 data bytes
From 2a01:4f8:***:***::2 icmp_seq=1 Destination unreachable: Address unreachable

我錯過了什麼嗎?

我的系統的正確語法是什麼?

這方面的文檔在哪裡?

答案1

嘗試:

up ip -6 addr add 2a01:4f8:***:***::3/64 dev eth0

我很驚訝網關 fe80::1 在沒有尾隨 %eth0 的情況下工作。我不確定我是否理解您的 /64 是如何路由給您的。

答案2

如果你想要多個 ip[6] 位址,請在 /etc/network/interfaces 中使用此語法

auto eth0
iface eth0 inet6 static
  address 2a01:4f8:***:***::2
  netmask 64

auto eth0:2
iface eth0:2 inet6 static
  address 2a01:4f8:***:***::3
  netmask 64

重新啟動網路後ifup eth0:2,您可以檢查ip -6 addr show dev eth0您的介面是否有這兩個位址

相關內容