我的VPS服务器分配了1个IPv4和2个IPv6地址,但似乎只有一个工作。
我的接口configuration
auto eth0 iface eth0 inet static address 184.82.222.136 gateway 184.82.222.1 netmask 255.255.255.0 iface eth0 inet6 static up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf up echo 0 > /proc/sys/net/ipv6/conf/default/autoconf netmask 64 gateway 2607:f878:0001:0aec:0000:0000:0000:0001 address 2607:f878:1:aec::218a:4537 auto eth0:0 iface eth0:0 inet6 static up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf up echo 0 > /proc/sys/net/ipv6/conf/default/autoconf netmask 64 address 2607:f878:1:aec::d4bf:2d9d auto lo iface lo inet loopback
当我运行/etc/init.d/networking停止&& /etc/init.d/networking开始我得到
Deconfiguring network interfaces...done. Configuring network interfaces...SIOCSIFFLAGS: Cannot assign requested address Failed to bring up eth0:0. done.
我看到我的网卡与它有关。 这是真的吗? 我是否需要与我的VPS提供商交谈以手动将IP分配给此接口?
(与Xen的Debian 6)
更新!
我尝试了新的上下技术,仍然没有工作。
auto eth0 allow-hotplug eth0 iface eth0 inet static address 184.82.222.136 gateway 184.82.222.1 netmask 255.255.255.0 iface eth0 inet6 static up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf up echo 0 > /proc/sys/net/ipv6/conf/default/autoconf netmask 64 gateway 2607:f878:0001:0aec:0000:0000:0000:0001 address 2607:f878:1:aec::218a:4537 up ip addr add 2607:f878:1:aec::d4bf:2d9d dev eth0 label eth0:0 down ip addr del 2607:f878:1:aec::d4bf:2d9d dev eth0 label eth0:0 auto lo iface lo inet loopback
仍然第一个IPv6正在工作,第二个不是。
别名eth0:0接口用于IPv4,传统上每个接口多个地址是不允许的。 (使用ip工具,您可以将多个IPv4和IPv6地址添加到接口,但是ifconfig不会显示额外的IPv4地址,因此使用eth0:0仍然很常见)
将您的configuration更改为:
up ip addr add 2607:f878:1:aec::d4bf:2d9d dev eth0 down ip addr del 2607:f878:1:aec::d4bf:2d9d dev eth0
它应该工作。