Checks whether an IP address is a loopback address.
is_loopback(x:ip) -> bool
Description
Section titled “Description”The is_loopback
function checks whether a given IP address x
is a loopback
address.
For IPv4, loopback addresses are in the range 127.0.0.0 to 127.255.255.255 (127.0.0.0/8).
For IPv6, the loopback address is ::1.
Examples
Section titled “Examples”Check if an IP is loopback
Section titled “Check if an IP is loopback”from { ipv4_loopback: 127.0.0.1.is_loopback(), ipv6_loopback: ::1.is_loopback(), not_loopback: 8.8.8.8.is_loopback(),}
{ ipv4_loopback: true, ipv6_loopback: true, not_loopback: false,}
See Also
Section titled “See Also”is_v4
,
is_v6
,
is_multicast
,
is_private
,
is_global
,
is_link_local
,
ip_category