IP V6 range

  • ran.ovadia

    Ten Centuries

    Points: 1177

    Hi,

    I have table of IPv6 range such as:

    2001:254::/32 or 2001:420:4490::/44

    Does anybody have function to check if given IPv6 address is between a range?
    For example:

    b36a:7501:7451:3b1:e6ff:5f12:62d4:7a51

    Thanks,
    Ran.

  • Eirikur Eiriksson

    SSC Guru

    Points: 182347

    ran.ovadia - Saturday, July 14, 2018 11:57 PM

    Hi,

    I have table of IPv6 range such as:

    2001:254::/32 or 2001:420:4490::/44

    Does anybody have function to check if given IPv6 address is between a range?
    For example:

    b36a:7501:7451:3b1:e6ff:5f12:62d4:7a51

    Thanks,
    Ran.

    As this can be done in few ways, but one would have to know more about how / why to determine which method to use.
    😎

    The IPv6 is in simple terms, just a 128 bit number and address blocks are normally presented using CIDR (Classless Inter-Domain Routing) notation where the block prefix size in bits is the number after the slash. This means that for the range 2001:254::/32, there are 2^(128-32) = 2^96 = 79,228,162,514,264,337,593,543,950,336 addresses, all starting with the same 32 bit prefix.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply