【发布时间】:2020-12-19 04:33:09
【问题描述】:
在 IPv6 地址中,我们可以看到一个区域 id 附加了百分位 % 字符(例如 fe80::1ff:fe23:4567:890a%3),用于标识接口。但是为什么我们不在 IPv4 地址中使用它们呢?
【问题讨论】:
-
因为每个 IPv6 接口具有相同的网络,所以您需要区域 ID 来确定发送到该网络时所指的接口。
标签: networking ipv6 ipv4
在 IPv6 地址中,我们可以看到一个区域 id 附加了百分位 % 字符(例如 fe80::1ff:fe23:4567:890a%3),用于标识接口。但是为什么我们不在 IPv4 地址中使用它们呢?
【问题讨论】:
标签: networking ipv6 ipv4
但是我检查了ipv4 netconf,ipv4-address的描述提到了zone id。 http://www.netconfcentral.org/modules/ietf-inet-types
typedef ipv4-address {
type string {
pattern
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+ '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+ '(%[\p{N}\p{L}]+)?';
}
description
"The ipv4-address type represents an IPv4 address in
dotted-quad notation. The IPv4 address may include a zone
index, separated by a % sign.
The zone index is used to disambiguate identical address
values. For link-local addresses, the zone index will
typically be the interface index number or the name of an
interface. If the zone index is not present, the default
zone of the device will be used.
The canonical format for the zone index is the numerical
format";
}
【讨论】: