Expand description

iprange is a library for managing IP ranges.

An IpRange is a set of networks. The type of the networks it holds is specified by the generics type of IpRange.

You can add or remove an IpNet from an IpRange. An IpNet can be either an Ipv4Net or an Ipv6Net.

It also supports these useful operations:

Here is a simple example:

extern crate iprange;
extern crate ipnet;

use std::net::Ipv4Addr;
use iprange::IpRange;
use ipnet::Ipv4Net;

fn main() {
    let ip_range: IpRange<Ipv4Net> = ["", "", ""]
        .map(|s| s.parse().unwrap())



A set of networks that supports various operations:

An iterator over the networks in an IpRange.

Node of the inner radix trie.


An abstraction for IP networks.

Anything that can be converted to IpNet.