Coder Social home page Coder Social logo

subnet-removal's Introduction

subnet_removal: Subnet filtering for IPv4 and IPv6 prefixes

subnet_removal - Filters out child prefixes read from a file, or passed from standard input.

Can be used as a module or as a standalone shell utility.

More details @ https://ttl255.com/subnet-filtering-with-python/

Import as a module

>>> from subnet_removal import filter_out_subnets
>>> pfxs = ["10.0.1.0/24", "10.0.1.128/25", "10.0.1.192/28"]
>>> pfxs_filt = filter_out_subnets(pfxs)
>>> print(pfxs_filt)
['10.0.1.0/24']

>>> ipv6pfxs = ["2001:db8::/48", "2001:db8:0:a::/64", "2001:db8:0:b::/64", "2001:db8:1:a::/64"]
>>> ipv6pfxs_filt = filter_out_subnets(ipv6pfxs, ipv6=True)
>>> print(ipv6pfxs_filt)
['2001:db8::/48', '2001:db8:1:a::/64']

Shell usage:

  • Filter out prefixes read from a file
$ subn_rm pfxs_ex_01.txt [-ipv6]

ipv6 flag enables processing of IPv6 prefixes

subnet-removal's People

Contributors

progala avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.