Skip to main content

ipSubnet

ipSubnet(str: String) : IpSubnet

Returns a subnet from a string, such as ipSubnet("1.2.3.4/24").

ipSubnet(ipAddr: Ipv4Address, prefixLength: Number): IpSubnet

Returns a subnet from an IP address and length, such as ipSubnet(ipAddress("1.2.3.4"), 24).

ipSubnet(ipAddr: Ipv4Address, netMask: Ipv4Address): IpSubnet

Returns a subnet from an IP address and a net mask represented as an IP address, such as ipSubnet(ipAddress("1.2.3.4"), ipAddress("255.255.128.0")), which is equivalent to ipSubnet("1.2.3.4/17"). This function will raise an error if the net mask parameter (second parameter) is not a valid subnet mask (an IP address that consists of some number of leading 1 bits followed by all 0 bits).

See also

Types

Functions