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

查看:522
本文介绍了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 request could not find host fe80::9dc8:72fa:e327:76e2%10.
Please check the name and try again.

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

Any ideas/comments are very helpful.

推荐答案

地址后的%10被称为链接本地 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 addresses,然后将%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天全站免登陆