MaddSubnet
Bun

method

net.BlockList.addSubnet

prefix: number
): void;

Adds a rule to block a range of IP addresses specified as a subnet mask.

@param net

The network IPv4 or IPv6 address.

@param prefix

The number of CIDR prefix bits. For IPv4, this must be a value between 0 and 32. For IPv6, this must be between 0 and 128.

net: string,
prefix: number,
type?: IPVersion
): void;

Adds a rule to block a range of IP addresses specified as a subnet mask.

@param net

The network IPv4 or IPv6 address.

@param prefix

The number of CIDR prefix bits. For IPv4, this must be a value between 0 and 32. For IPv6, this must be between 0 and 128.

@param type

Either 'ipv4' or 'ipv6'.

Referenced types

  • readonly address: string

    Either 'ipv4' or 'ipv6'.

  • readonly family: IPVersion

    Either 'ipv4' or 'ipv6'.

  • readonly flowlabel: number
  • readonly port: number
  • static parse(
    input: string
    ): undefined | SocketAddress;
    @param input

    An input string containing an IP address and optional port, e.g. 123.1.2.3:1234 or [1::1]:1234.

    @returns

    Returns a SocketAddress if parsing was successful. Otherwise returns undefined.

type IPVersion = 'ipv4' | 'ipv6'