IPV6自动配置不起作用

在Windows 7中,我的计算机可以自动获取IPV6全局地址并使用IPV6网络,但在Ubuntu Natty中,我无法找到如何让无状态配置工作。 我的网络是大学校园网,所以我不需要隧道。 我认为如果有一件事可以在Windows中无声地成功完成,那么在linux中应该不可能。

我尝试手动编辑/ etc / network / interfaces并使用静态IPV6地址,我可以这样使用IPV6,但我只想使用自动配置。

我发现这篇post: https : //superuser.com/questions/33196/how-to-disable-autoconfiguration-on-ipv6-in-linux

并尝试过

sudo sysctl -w net.ipv6.conf.all.autoconf=1 sudo sysctl -w net.ipv6.conf.all.accept_ra=1 

但没有任何运气。

我在dmesg得到了这个:

 root@natty-150:~# dmesg |grep IPv6 [ 26.239607] eth0: no IPv6 routers present [ 657.365194] eth0: no IPv6 routers present [ 719.101383] eth0: no IPv6 routers present [32864.604234] eth0: no IPv6 routers present [33267.619767] eth0: no IPv6 routers present [33341.507307] eth0: no IPv6 routers present 

我不确定它是否重要,但后来我设置了一个静态IPv6地址(带网关)并重新启动网络,我ping了ipv6.google.com并且ipv6网络很好。这次在dmesg中添加了一个条目

 [33971.214920] eth0: no IPv6 routers present 

所以我想没有IPv6路由器的抱怨没关系?

这是ipv6转发设置。但我猜想转发用于radvd的东西?

 root@natty-150:/# cat /proc/sys/net/ipv6/conf/eth0/forwarding 0 

在ajmitch提到转发设置之后,我将其添加到sysctl.conf文件中:

 net.ipv6.conf.all.autoconf = 1 net.ipv6.conf.all.accept_ra = 1 net.ipv6.conf.default.forwarding = 1 net.ipv6.conf.lo.forwarding = 1 net.ipv6.conf.eth0.forwarding = 1 

然后运行sysctl -p /etc/init.d/networking restart但这仍然无效。

禁用转发应该解决您的问题。

提示:只有路由器需要转发。

另一个提示。 enable forwarding =禁用无状态autoconfig

一种选择是升级到Oneiric(Ubuntu 11.10) ,并在/etc/network/interfaces使用其IPv6 auto方法

 iface eth0 inet6 auto 

您还需要一个auto eth0子句,因此最低可行的IPv6配置如下所示:

 auto eth0 iface eth0 inet6 auto