Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

common_network

Find the common network of two addresses


Description

Returns the smallest network that contains both addresses.

This can construct a network from its first and last addresses. However, if the address range does not match the network boundaries, then the result extends beyond the original address range. Use summarize_address_range() to receive a list of networks that exactly match the address range.

Usage

common_network(address1, address2)

Arguments

address1

An ip_address vector

address2

An ip_address vector

Value

An ip_network vector

See Also

Examples

# address range matches network boundaries
common_network(ip_address("192.168.0.0"), ip_address("192.168.0.15"))

# address range does not match network boundaries
common_network(ip_address("192.167.255.255"), ip_address("192.168.0.16"))

ipaddress

Tidy IP Addresses

v0.5.1
MIT + file LICENSE
Authors
David Hall [aut, cre] (<https://orcid.org/0000-0002-2193-0480>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.