windows IPv6 链路本地地址格式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5746082/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IPv6 link-local address format
提问by pdk
I am working on a project related to networking/compression. One of the machines is Windows Vista, which already has IPv6 configured.
我正在做一个与网络/压缩相关的项目。其中一台机器是 Windows Vista,它已经配置了 IPv6。
When I try ipconfig
, I see an address in the following format: fe80::9dc8:72fa:aacd:76e2%10
当我尝试时ipconfig
,我看到以下格式的地址:fe80::9dc8:72fa:aacd:76e2%10
But when I try to ping this machine from another with ping fe80::9dc8:72fa:aacd:76e2%10
, I get the following error:
但是,当我尝试从另一台机器 ping 这台机器时ping fe80::9dc8:72fa:aacd:76e2%10
,出现以下错误:
Ping request could not find host fe80::9dc8:72fa:e327:76e2%10.
Please check the name and try again.
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.
任何想法/评论都非常有帮助。
回答by mpontillo
The %10
after the address is called the scope zone. When you use link-localIPv6 addresses, the scope zone is required so that the system knows which interface to send the packet out on.
该%10
地址后,被称为域中。当您使用链路本地IPv6 地址时,需要范围区域,以便系统知道将数据包发送到哪个接口。
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:
在 Windows 上,如果您发出netsh interface ipv6 show addresses
命令,您将看到分配给系统的地址及其区域 ID。请注意,区域 ID 与接口索引匹配。例如:
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
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.
此地址是有范围的,%22
因为它位于索引为 的接口上22
。同样,在 Linux 上,您可能会看到像fe80::15c3:6bea:aaac:a016%eth0
. 区域 ID 的格式对于运行 IPv6 的每台机器都是唯一的,这就是为什么如果您尝试从其他系统执行 ping 操作可能会有所不同。
For example, if you have:
例如,如果您有:
System A (Windows): fe80::15c3:6bea:aaac:a015%22
System B (Linux): fe80::15c3:6bea:aaac:a016%eth0
... and you want to ping the Linux box from the Windows box, you cannot do ping fe80::15c3:6bea:aaac:a016%eth0
. But you cando ping fe80::15c3:6bea:aaac:a016%22
. This is the problem. Link-local addresses can be tricky in this way.
...并且您想从 Windows 机器 ping Linux 机器,您不能这样做ping fe80::15c3:6bea:aaac:a016%eth0
。但是你可以做到ping fe80::15c3:6bea:aaac:a016%22
。这就是问题。链接本地地址以这种方式可能会很棘手。
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.
尝试指定正确的区域 ID。也就是说,当你做你的时候ping fe80::9dc8:72fa:aacd:76e2%10
,首先netsh interface ipv6 show addresses
在你从ping 的机器上做,然后将 更改%10
为你想在源系统上使用的任何接口的接口索引。
If the machine you are pinging fromis 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).
如果你是执行ping机器从是Linux,你将不得不这样做ping6 -I eth0 fe80::9dc8:72fa:aacd:76e2
(假设其他系统上eth0
),因为Linux的命令行实用程序不支持%
指定的区域的方式(我最后一次检查,反正)。
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 unicastaddresses. Then this will not be an issue.
理想情况下,您应该在您的网络上设置一个支持 IPv6 的路由器来执行路由器广告,以便您可以使用无状态地址自动配置 (SLAAC)并获取全局单播地址。那么这将不是问题。
回答by knittl
you cannot ping ipv6 addresses with the classic ping utility, only ipv4 addresses. linux has a commandline tool called ping6
to ping ipv6 addresses, windows probably has something similar. a little research told me that windows uses ping -6
for pinging ipv6 addresses.
您不能使用经典的 ping 实用程序 ping ipv6 地址,只能 pingv4 地址。linux 有一个命令行工具ping6
可以用来 ping ipv6 地址,windows 可能有类似的东西。一些研究告诉我 Windowsping -6
用于 ping ipv6 地址。
回答by knittl
The number after % is the interface name. if you open the status->detail of your network interface, you will see the ipv6 link-local address, with the %xx at the end of the address, which is the index of the interface, in case you want to find the index for some application. The System Information or ipconfig might just give you different index numbers, at least on my Windows 7 Pro, which is very confusing. The description you get from the OS could also be wrong.
% 后面的数字是接口名称。如果你打开你的网络接口的状态->详细信息,你会看到ipv6链接本地地址,地址末尾有%xx,这是接口的索引,以防万一你想找到索引对于某些应用程序。系统信息或 ipconfig 可能只是给你不同的索引号,至少在我的 Windows 7 Pro 上,这非常令人困惑。您从操作系统获得的描述也可能是错误的。