Skip to content
Legacy docs for Tenzir v5.x. For the latest Tenzir v6 series, visit docs.tenzir.com. Migrating from v5? Read the Tenzir v6 migration guide.

Checks whether an IP address is a link-local address.

is_link_local(x:ip) -> bool

The is_link_local function checks whether a given IP address x is a link-local address.

For IPv4, link-local addresses are in the range 169.254.0.0 to 169.254.255.255 (169.254.0.0/16).

For IPv6, link-local addresses are in the range fe80::/10.

Link-local addresses are used for communication between nodes on the same network segment and are not routable on the internet.

from {
ipv4_link_local: 169.254.1.1.is_link_local(),
ipv6_link_local: fe80::1.is_link_local(),
not_link_local: 192.168.1.1.is_link_local(),
}
{
ipv4_link_local: true,
ipv6_link_local: true,
not_link_local: false,
}

Last updated: