IPv6 链路本地地址格式 [英] IPv6 link-local address format

查看:33
本文介绍了IPv6 链路本地地址格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个与网络/压缩相关的项目.其中一台机器是 Windows Vista,它已经配置了 IPv6.

I am working on a project related to networking/compression. One of the machines is Windows Vista, which already has IPv6 configured.

当我尝试 ipconfig 时,我看到以下格式的地址:fe80::9dc8:72fa:aacd:76e2%10

When I try ipconfig, I see an address in the following format: fe80::9dc8:72fa:aacd:76e2%10

但是当我尝试使用 ping fe80::9dc8:72fa:aacd:76e2%10 从另一台机器 ping 这台机器时,我收到以下错误:

But when I try to ping this machine from another with ping fe80::9dc8:72fa:aacd:76e2%10, I get the following error:

Ping 请求找不到主机 fe80::9dc8:72fa:e327:76e2%10.
请检查名称并重试.

任何想法/评论都非常有帮助.

Any ideas/comments are very helpful.

推荐答案

地址后面的%10叫做范围区域.当您使用 link-local IPv6 地址时,范围区域是必需的,以便系统知道将数据包发送到哪个接口.

The %10 after the address is called the scope zone. When you use link-local IPv6 addresses, the scope zone is required so that the system knows which interface to send the packet out on.

在 Windows 上,如果您发出 netsh interface ipv6 show addresses 命令,您将看到分配给系统的地址及其区域 ID.请注意,区域 ID 与接口索引匹配.例如:

On Windows, if you issue the netsh interface ipv6 show addresses command, you'll see the addresses assigned to the system complete with their zone IDs. Notice that the zone IDs match the interface index. For example:

Interface 22: VirtualBox Host-Only Network

Addr Type  DAD State   Valid Life Pref. Life Address
---------  ----------- ---------- ---------- ------------------------
Other      Preferred     infinite   infinite fe80::15c3:6bea:aaac:a015%22

这个地址的范围是%22,因为它位于索引为22的接口上.同样,在 Linux 上,您可能会看到类似 fe80::15c3:6bea:aaac:a016%eth0 的本地链接地址.区域 ID 的格式对于运行 IPv6 的每台机器都是唯一的,这就是为什么如果您尝试从其他系统执行 ping 操作,它可能会有所不同.

This address is scoped %22 because it is on an interface whose index is 22. Similarly, on Linux, you might see a link-local address like fe80::15c3:6bea:aaac:a016%eth0. The format of the zone ID is unique to each individual machine running IPv6, which is why it might be different if you try the ping from the other system.

例如,如果您有:

System A (Windows): fe80::15c3:6bea:aaac:a015%22
System B (Linux):   fe80::15c3:6bea:aaac:a016%eth0

... 并且您想从 Windows 机器 ping Linux 机器,您不能执行 ping fe80::15c3:6bea:aaac:a016%eth0.但是你可以ping fe80::15c3:6bea:aaac:a016%22.这就是问题.链接本地地址以这种方式可能会很棘手.

... and you want to ping the Linux box from the Windows box, you cannot do ping fe80::15c3:6bea:aaac:a016%eth0. But you can do ping fe80::15c3:6bea:aaac:a016%22. This is the problem. Link-local addresses can be tricky in this way.

尝试指定正确的区域 ID.也就是说,当你做你的ping fe80::9dc8:72fa:aacd:76e2%10时,首先在你要ping的机器上做netsh interface ipv6 show addressesfrom,并将 %10 更改为您要在源系统上使用的任何接口的接口索引.

Try specifying the correct zone ID. That is, when you do your ping fe80::9dc8:72fa:aacd:76e2%10, first do netsh interface ipv6 show addresses on the machine you are pinging from, and change the %10 to the interface index for whichever interface you want to use on the source system.

如果您要 ping 来自 的机器是 Linux,则您必须执行 ping6 -I eth0 fe80::9dc8:72fa:aacd:76e2(假设另一个系统在 eth0 上),因为 Linux 命令行实用程序不支持 % 指定区域的方式(反正我最后一次检查过).

If the machine you are pinging from is Linux, you will have to do ping6 -I eth0 fe80::9dc8:72fa:aacd:76e2 (assuming the other system is on eth0), because the Linux command-line utility does not support the % way of specifying the zone (the last time I checked, anyway).

理想情况下,您应该在您的网络上设置一个支持 IPv6 的路由器来进行路由器广告,以便您可以使用 无状态地址自动配置 (SLAAC) 并获得 全球单播地址.那么这将不是问题.

Ideally you should set up an IPv6-capable router on your network to do router advertisements, so that you can use stateless address auto-configuration (SLAAC) and get global unicast addresses. Then this will not be an issue.

这篇关于IPv6 链路本地地址格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆