在 Windows 7 中,我的计算机可以自动获取 IPV6 全局地址并使用 IPV6 网络,但是在 Ubuntu Natty 中,我无法找到如何让无状态配置工作。我的网络是大学校园网,所以我不需要隧道。我想如果一件事可以在 Windows 中默默地成功完成,那么在 linux 中应该不是不可能的。
我尝试手动编辑 /etc/network/interfaces 并使用静态 IPV6 地址,我可以通过这种方式使用 IPV6,但我只想使用自动配置。
我找到了这篇文章: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
Run Code Online (Sandbox Code Playgroud)
但没有任何运气。
我在 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
Run Code Online (Sandbox Code Playgroud)
我不确定这是否重要,但后来我设置了一个静态 IPv6 地址(带网关)并重新启动网络,我 ping6 ipv6.google.com 并且 ipv6 网络很好。这次在 dmesg 中添加了一个条目
[33971.214920] eth0: no IPv6 routers present
Run Code Online (Sandbox Code Playgroud)
所以我想抱怨没有 IPv6 路由器无关紧要?
这是 ipv6 转发设置。但我猜转发是用于 radvd 的东西?
root@natty-150:/# cat /proc/sys/net/ipv6/conf/eth0/forwarding
0
Run Code Online (Sandbox Code Playgroud)
在 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
Run Code Online (Sandbox Code Playgroud)
然后运行 sysctl -p /etc/init.d/networking restart 但这仍然不起作用。
一种选择是升级到 Oneiric (Ubuntu 11.10),并使用其 IPv6auto方法/etc/network/interfaces
iface eth0 inet6 auto
Run Code Online (Sandbox Code Playgroud)
您还需要一个auto eth0子句,因此最小可行的 IPv6 配置如下所示:
auto eth0
iface eth0 inet6 auto
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
39727 次 |
| 最近记录: |