Coder Social home page Coder Social logo

isabella232 / whois-quagga Goto Github PK

View Code? Open in Web Editor NEW

This project forked from certtools/whois-quagga

0.0 0.0 0.0 18 KB

whois interface to quagga (BGP routing daemon) to do IP 2 ASN lookups

License: GNU Affero General Public License v3.0

Perl 100.00%

whois-quagga's Introduction

quagga whois

Whois interface to quagga (BGP routing daemon) to do IP 2 ASN lookups

This code was originally developed by Otmar Lendl [email protected] and released to the public. See the corresponding LICENSE file

What does it do?

This script gets added to /etc/inetd.conf for port 43 whois, RFC3912 requests. It will then look at the request. If it's an IP address, it will look up the current ASN which announces the most specific matching netblock enclosing the ip address and return this ASN.

Usage


$ whois -h localhost help

CERT.at BGP whois.

Usage:

   $ whois -h qualle.cert.at [tags] IP ...

   tags select specific BGP table attributes. Possible values:

    block   return the prefix in CIDR notation
    mask    return the netmask
    path    return the full AS-path
    origin  return the first AS in the path (ignore aggregation)
    community   return the community tags of the route

    IP can be a list of IPv4 and IPv6 addresses.
    The special values "v4table" and "v6table" produce a dump of the full
    routing tables. These dumps cannot include the community attribute.

/ol/2k9/07/17, last change 2010/05/24


Example: let's assume you want to figure out the ASN of the IP address 83.136.33.1:

$ whois -h localhost origin 83.136.33.1
83.136.33.1 30971

Hence the ASN is 30971.

Requirements

A working quagga instance with a full BGP table feed. A working vtysh -c command.

How to install?

Put this into /etc/inetd.conf:

whois   stream  tcp     nowait  nobody  /usr/local/bin/quagga-whois.pl quagga-whois.pl

Adjust the paths to your needs of course.

Next, edit the quagga-whois.pl script and replace my $ORG = "CERT.at"; (CERT.at) with your organisation name.

Contributing

Please send us pull requests via github.com

whois-quagga's People

Contributors

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