Name: whois-quagga
Owner: CERT-Tools
Description: whois interface to quagga (BGP routing daemon) to do IP 2 ASN lookups
Created: 2016-01-10 15:36:17.0
Updated: 2017-01-19 00:18:39.0
Pushed: 2016-11-29 18:35:17.0
Homepage: null
Size: 18
Language: Perl
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Whois interface to quagga (BGP routing daemon) to do IP 2 ASN lookups
This code was originally developed by Otmar Lendl lendl@cert.at and released to the public. See the corresponding LICENSE file
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.
ois -h localhost help
.at BGP whois.
e:
whois -h qualle.cert.at [tags] IP ...
ags 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.
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:
ois -h localhost origin 83.136.33.1
36.33.1 30971
Hence the ASN is 30971.
A working quagga instance with a full BGP table feed. A working vtysh -c
command.
Put this into /etc/inetd.conf:
s 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.
Please send us pull requests via github.com