如何解决为什么我们在IPv4地址中没有区域ID如%字符后的IPv6地址?
在IPv6地址中,我们可以看到一个区域ID附加百分号%字符(例如fe80::1ff:fe23:4567:890a%3
)以标识接口。但是为什么我们不将它们包含在IPv4地址中?
解决方法
但是我检查了ipv4 netconf,对ipv4-address的描述提到了区域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";
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。