Skip to content

proposal: net: add IsCGNAT to the net.IP type #76067

@thomasmarton

Description

@thomasmarton

Proposal Details

The standard library for Go already provides a ton of convenience methods for developers looking to filter out for specific IP addresses. For example IsPrivate checks if the IP belongs to a private network defined in RFC1918 or IsLoopback that checks if the IP address is a loopback address.

I'd like to propose a similar method called IsCGNAT that checks if the IP belongs to the Carrier Grade NAT space defined by RFC 6598.

The method would return a bool just like all the other helper methods and to avoid changing the current API conventions, it would return false for any IPv6 address provided as there is no current RFC for an IPv6 based CGNAT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposalWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions