blockList.addSubnet(net, prefix[, type])


  • net <string> | <net.SocketAddress> 网络 IPv4 或 IPv6 地址。
  • prefix <number> CIDR 前缀位数。 对于 IPv4,这必须是 032 之间的值。 对于 IPv6,它必须在 0128 之间。
  • type <string> 'ipv4''ipv6'默认值: 'ipv4'

添加规则以阻止指定为子网掩码的 IP 地址范围。

  • net <string> | <net.SocketAddress> The network IPv4 or IPv6 address.
  • prefix <number> 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.
  • type <string> Either 'ipv4' or 'ipv6'. Default: 'ipv4'.

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