IPv4环回地址块的大小

网络工程 协议论
2022-02-28 18:00:31

根据rfc3330,环回块是 127.0.0.0/8:

   127.0.0.0/8 - This block is assigned for use as the Internet host
   loopback address.  A datagram sent by a higher level protocol to an
   address anywhere within this block should loop back inside the host.
   This is ordinarily implemented using only 127.0.0.1/32 for loopback,
   but no addresses within this block should ever appear on any network
   anywhere [RFC1700, page 5].

这个块这么大是有原因的吗?有没有配置127.0.0.0/8以外的127.0.0.1/8以外的其他地址的场合?

1个回答

它来自classful IP 时代,127.0.0.0 是A 类网络,因此分配了/8 掩码。

回答第二部分:是的,我见过使用超过 127.0.0.1 的设置,例如在一台主机或数据库服务器的多个实例上运行多个 SMTP 内容过滤器。

请注意,对于 IPv6,您只有一个环回地址 ::1