Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>cidr-ip-rangeNew to Visual Studio Code? Get it now.
cidr-ip-range

cidr-ip-range

lukepearson

|
2,770 installs
| (5) | Free
Shows the ip range covered by a cidr block
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

cidr-ip-range README

Features

Shows annotations for IPV4 cidr ranges with the number of addresses in the range.

Tooltip provides more detailed information on hover.

CIDR tooltip and annotations

Uses the cidr-regex and ip libraries to find ipv4 cidr ranges in open documents and display information about them.

Options

Format tooltip

You can choose which information to display, and in what order by modifying the "cidr-ip-range.display" configuration option in settings.

"cidr-ip-range.display": [
    "networkAddress",
    "numHosts",
    "addressRange",
]

Toggle codelens

There is a codelens action to copy the information to the clipboard, which can be enabled by adding the following to your settings.json

{
  "cidr-ip-range.enableCodeLens": true,
  "cidr-ip-range.codeLensFormat": "json"
},

Change codelens copy format

You can alternatively copy the data as it appears in the table by changing the codeLensFormat to "table"

{
  "cidr-ip-range.enableCodeLens": true,
  "cidr-ip-range.codeLensFormat": "table"
},

Toggle inline decorator

You can enable or disable the inline decorator which shows how many IP addresses are in a range

{
  "cidr-ip-range.enableDecorator": false,
},

Toggle strict mode

You can enable or disable strict CIDR notation, which requires the CIDR range to use the first IP address in the range. Enabling this option will highlight invalid ranges

{
  "cidr-ip-range.enableStrict": true,
},

Full list of configuration options

{
  "cidr-ip-range.enableCodeLens": {
    "type": "boolean",
    "description": "Enables a CodeLens with an action to copy the CIDR range information to the clipboard",
    "default": false
  },
  "cidr-ip-range.enableDecorator": {
    "type": "boolean",
    "description": "Enables the inline decorator that shows how many IP addresses are in a range",
    "default": true
  },
  "cidr-ip-range.enableStrict": {
    "type": "boolean",
    "description": "Requires the CIDR range to use the first IP in the range e.g. 10.82.184.0/22 instead of 10.82.187.0/22",
    "default": false
  },
  "cidr-ip-range.codeLensFormat": {
    "type": "string",
    "enum": [
      "json",
      "table"
    ],
    "default": "json",
    "description": "Sets which format the CIDR range information will be copied as"
  },
  "cidr-ip-range.display": {
    "type": "array",
    "description": "Allows you to choose which information to display in the tooltip. The order of items also determines their order in the tooltip.",
    "default": ["networkAddress", "numHosts", "addressRange", "hostRange", "broadcast"]
  },
}

Still to do

Support IPV6

Release Notes

0.0.1

Initial release of cidr-ip-range

0.0.4

Added codelens ability to copy data to clipboard, suggested by Thomas Schlesinger

0.0.5

Added copy to clipboard format types (json / table)

0.0.6

Added configuration option to toggle the inline decoration

[Issue #1](https://github.com/lukepearson/vscode-extension-cidr-ip-range/issues/1) - Reported by Jake Ginnivan

0.0.7

Fixed configuration options defaults and removed typo in copy to table

0.0.8

Added strict mode, suggested by makeacode

0.0.9

Reformatted to show host range and address range separately, suggested by Ernests Auzins

### 0.0.10

Allow configuration of display items using the "cidr-ip-range.display" configuration property. The order of the display items also determines the order in the tooltip.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft