Skip to content

Feature Request: extent IsInSubnet to support Subnet-to-Subnet Containment #185

Description

@oryaacov

Feature Request: Add Subnet-to-Subnet Containment Support

Opening words

You guys are doing an amazing work! thank you guys! :)

Summary

Add support for checking if one subnet is contained within another subnet.

Current vs Requested Behavior

Current:

isInSubnet('10.5.0.1', '10.4.5.0/16'); // IP in subnet

Requested:

isInSubnet('10.5.0.0/24', '10.4.0.0/16'); // true - subnet in subnet
isInSubnet('10.5.0.0/16', '10.4.0.0/24'); // false - larger cannot fit in smaller
isInSubnet('2001:db8:1::/64', '2001:db8::/32'); // true - IPv6 support

Use Cases

  • Network planning and IPAM validation
  • Security policy verification
  • Cloud infrastructure subnet management

This would make the library much more useful for network management tasks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions