Coder Social home page Coder Social logo

asn-tools's Introduction

asn-tools

A collection of scripts to automate BGP filter creation on a ubiquti EdgeOS (and VyOS/Vyatta).

In this repo included are:

confgen.rb - generates router configuration based on the config file

whoisgen.rb - generates import/export rules for the RIPE whois database.

filtergen.sh - generates import filters based on the IRRDBs (RADB,RIPE,ARIN)

The scripts were built with modularity in mind and so the templates are utilized to allow for easy extension.

Example config file

---
config:
  ouras: 31337
router:
  rtr1:
    model: vyatta
    upstream:
      42:
        name: ACME Inc.
        community: 1001
        ipv4:
          import: ANY
          export: AS-ELITE
          local-ip: 1.2.3.4
          remote-ip: 42.42.42.42
          interface: exchange
        ipv6:
          import: ANY
          export: AS-ELETE
          local-ip: 2000:1234::1
          remote-ip: 2000:1234::2
          interface: exchange
    peering:
      666:
        community: 3666
        name: HELL Inc.
        ipv4:
          import: AS-HELL
          export: AS-ELETE
          local-ip: 1.2.3.4
          remote-ip: 6.6.6.6
          interface: exchange
          maximum-prefix: 500
          password: Secret
        ipv6:
          import: AS-HELL
          export: AS-ELETE
          local-ip: 2000:1234::1
          remote-ip: 2000:1234::666
          interface: exchange
          maximum-prefix: 100
          password: Secret

Generating rules

Usage script.rb [options]
    -r, --router=ROUTER              Router hostname
    -t, --type=TYPE                  Peer type
    -a, --as=AS                      AS Number
    -A, --all                        Generate configuration for all peeers
    -h, --help                       Display this screen

i.e. confgen.rb -t peering -a 666 -r rtr1

Generating whois entries for RIPEDB

whoisen.rb

Generating filter lists

Warning: this script is an ugly hack, and a temporary solution only.

Usage: routebuilder 4|6 AS IMPORT

i.e. filtergen.sh 4 31337 AS-ELETE

asn-tools's People

Contributors

mikenowak 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.