Skip to content

Releases: lduchosal/ipnetwork

4.1.1

04 Apr 17:09

Choose a tag to compare

Fix

  • Fixed NullReferenceException when displaying IPv6 /128 networks (Broadcast, FirstUsable, LastUsable can be null)
  • Fixed release workflow: retired macos-13 runner, added --skip-duplicate for NuGet push

Downloads

Platform File
Windows x64 ipnetwork-win-x64.zip
macOS Apple Silicon ipnetwork-osx-arm64.tar.gz
macOS Intel ipnetwork-osx-x64.tar.gz
Linux x64 ipnetwork-linux-x64.tar.gz
Linux ARM64 ipnetwork-linux-arm64.tar.gz
Chocolatey choco install ipnetwork
NuGet (library) dotnet add package IPNetwork2

4.1.0

04 Apr 17:00

Choose a tag to compare

What's new

  • Native AOT binaries — self-contained, no .NET runtime required (~3MB)
  • Multi-platform release — macOS (ARM64, x64), Linux (x64, ARM64), Windows (x64)
  • Renamed binaryipnetwork instead of ConsoleApplication
  • Chocolatey — no longer requires dotnet-10.0-runtime dependency
  • GnuGetOpt 1.1.3 — strong-named on all platforms

Downloads

Platform File
Windows x64 ipnetwork-win-x64.zip
macOS Apple Silicon ipnetwork-osx-arm64.tar.gz
macOS Intel ipnetwork-osx-x64.tar.gz
Linux x64 ipnetwork-linux-x64.tar.gz
Linux ARM64 ipnetwork-linux-arm64.tar.gz
Chocolatey choco install ipnetwork
NuGet (library) dotnet add package IPNetwork2

IPNetwork2 v4.0.2

08 Mar 14:44

Choose a tag to compare

IPNetwork2 v4.0.2

Changes since 4.0.1

  • Removed obsolete static methods that had instance equivalents: Contains, Overlap, Print, Subnet, TrySubnet, Supernet, TrySupernet, IsIANAReserved(IPNetwork2)
  • Removed FilterEnum enum and ListIPAddress(FilterEnum) overload — use Filter and ListIPAddress(Filter) instead
  • Fixed Dependabot configuration (directory //src)
  • Removed unused files (.vscode/, qodana.yaml)
  • Added .DS_Store and .vscode/ to .gitignore

Full changelog since 3.x

See v4.0.1 release notes for the complete list of breaking changes and improvements in the 4.0 series.


❤️ Support the project

IPNetwork2 is free and open source. If it saves you time or you use it in production, consider supporting its development:

Thank you!

IPNetwork2 v4.0.1

07 Mar 20:45
ec127fb

Choose a tag to compare

IPNetwork2 v4.0.1

Breaking Changes

Target Framework

  • Dropped netstandard2.0 and System.Memory dependency
  • Supported targets: net8.0, net9.0, net10.0, netstandard2.1

Nullable Reference Types

  • Enabled <Nullable>enable</Nullable> with TreatWarningsAsErrors
  • All public API methods now have proper nullability annotations (?, [NotNullWhen(true)])
  • Consumers may see new compiler warnings if passing nullable types without null checks

Removed Obsolete Methods

  • Removed deprecated static methods that have instance equivalents: Contains, Overlap, Subnet, TrySubnet, Supernet, TrySupernet, Print, IsIANAReserved(IPNetwork2)
  • Removed FilterEnum enum and ListIPAddress(FilterEnum) overload
  • Use the instance methods instead

IANA Reserved Blocks (#376)

  • IsIANAReserved() now returns true for many more addresses — applications relying on the previous (incomplete) behavior may be affected
  • Added 11 IPv4 reserved blocks: This network (0.0.0.0/8), Loopback (127.0.0.0/8), Link-local (169.254.0.0/16), IETF Protocol (192.0.0.0/24), TEST-NET-1/2/3, Benchmarking (198.18.0.0/15), Multicast (224.0.0.0/4), Reserved (240.0.0.0/4), Broadcast (255.255.255.255/32)
  • Added 9 IPv6 reserved blocks: Unspecified (::/128), Loopback (::1/128), IPv4-mapped (::ffff:0:0/96), IPv4/IPv6 translation (64:ff9b::/96), TEREDO (2001::/32), Documentation (2001:db8::/32), Unique local (fc00::/7), Link-local (fe80::/10), Multicast (ff00::/8)
  • IsIANAReserved() now supports IPv6 addresses and networks natively

Improvements

Code Quality

  • Enabled EnforceCodeStyleInBuild and WarningLevel 5
  • Fixed CA2208: descriptive messages for all ArgumentException instances
  • Fixed IDE0041: pattern matching is null instead of ReferenceEquals
  • Fixed IDE0056: index-from-end operator [^1]
  • Fixed CA1847: string.Contains(char) instead of string.Contains(string)
  • Fixed CA1850: static SHA256.HashData on .NET 5+ targets
  • Fixed SA1507: removed multiple consecutive blank lines
  • Refactored InternalToNetmask and InternalSubnet from void to bool with [NotNullWhen(true)] — eliminated null-forgiving operators

Tests

  • Fixed MSTEST0051: Assert.ThrowsExactly lambdas now contain single statements
  • Fixed S2699: added missing assertions to 11 test methods
  • Removed obsolete #pragma warning disable 0618 pragmas
  • Added 72 new tests for IANA reserved blocks
  • 1298 tests, all passing

Misc

  • Fixed typo: sanitanizesanitize
  • Added .DS_Store to .gitignore

❤️ Support the project

IPNetwork2 is free and open source. If it saves you time or you use it in production, consider supporting its development:

Thank you!

IPNetwork2 v4.0.0

07 Mar 20:51
f6b1469

Choose a tag to compare

⚠️ Recommended upgrade: please use v4.0.1

Version 4.0.0 mistakenly kept the obsolete static methods (Contains, Overlap, Print, Subnet, Supernet, etc.) instead of removing them. Version 4.0.1 properly removes these methods.

If you are migrating from 3.x, go directly to 4.0.1.

3.5.3

06 Mar 22:39

Choose a tag to compare

Full Changelog: 3.5.2...3.5.3

3.5.2

06 Mar 21:59

Choose a tag to compare

Full Changelog: 3.5.1...3.5.2

3.5.1

06 Mar 21:42

Choose a tag to compare

Full Changelog: 3.5...3.5.1

3.5

06 Mar 21:07

Choose a tag to compare

3.5

What's Changed

Full Changelog: 3.4...3.5

ParseRange & TryParseRange

17 Aug 15:11
e4829c1

Choose a tag to compare

ParseRange and TryParseRange

A C# utility for converting IP address ranges into optimal CIDR blocks, supporting both IPv4 and IPv6 addresses.
Both IPv4 and IPv6 ranges are supported
The algorithm generates the minimal set of CIDR blocks that exactly cover the specified range
Input format must be "startIP - endIP" with a single hyphen separator
Whitespace around IP addresses is automatically trimmed
Mixed IPv4/IPv6 ranges are not supported (both addresses must be the same family)

IPv4 Example

string ipv4Range = "192.168.1.45 - 192.168.1.65";
var ipv4Blocks = IPNetwork2.ParseRange(ipv4Range);

Console.WriteLine($"CIDR blocks for {ipv4Range}:");
foreach (var block in ipv4Blocks)
{
Console.WriteLine($"  {block}");
}

Output

CIDR blocks for 192.168.1.45 - 192.168.1.65:
  192.168.1.45/32
  192.168.1.46/31
  192.168.1.48/28
  192.168.1.64/31

IPv6 Example

string ipv6Range = "2001:db8::1000 - 2001:db8::1fff";
var ipv6Blocks = IPNetwork2.ParseRange(ipv6Range);

Console.WriteLine($"CIDR blocks for {ipv6Range}:");
foreach (var block in ipv6Blocks)
{
Console.WriteLine($"  {block}");
}

Ouput

CIDR blocks for 2001:db8::1000 - 2001:db8::1fff:
  2001:db8::1000/116