ipv4
Last updated
Last updated
Extension for asserting IPv4 addresses
Returns true is the supplied IP belongs to the supplied subnet in CIDR notation.
Use this function to assert that a client belongs to a specific network.
IP-addresses should be octets in dotted-string format: '192.168.30.5'
Subnets are specified using CIDR notation containing an ip and the length of the subnet mask: '10.1.1.0/24'
ipv4.isInSubnet(ip, subnet)
Name | Type | Description |
---|---|---|
ip
string
The IP-address in octets
subnet
string
The subnet in CIDR-notation