bgp-as - Query the Optus Looking Glass
bgp-as --net=192.0.2.0/24
Give the network to be looked up in the BGP tables, for example, 192.0.2.0/24. The prefix is optional.
Choose either the 'Domestic' or 'International' table to query.
Print the manual page and exit.
Print a brief help message and exit.
This program uses http://looking-glass.optus.net.au/ to display the BGP table for the given network.
If this script isn't working, try using the website directly.
If this program exits with a zero exit status and the correct output is on standard output. Nothing else is ever printed to standard output.
This program will exit with a non-zero exit status if there was a fatal error. Both fatal and non-fatal errors will cause output on standard error.
If you need to access the Internet via a proxy, please ensure you have set the http_proxy environment variable.
Do not use this script in an automated way - here's the warning from the http://looking-glass.optus.net.au/ webpage:
Optus Looking Glass is NOT to be used with ANY automated
scripts. All queries must be entered manually. Abusers of
this policy will be permanently banned from this server.
Please respect their clearly stated wishes and just use this manually from the command line - don't force Optus to withdraw this valuable service to the Internet community
As per the dependencies, this script is not compatible with any automated usage.
$ ~/bin/bgp-as --net 150.101.98.0/24 --table International
% Network not in table
$ ~/bin/bgp-as --net 150.101.98.0 --table International
BGP routing table entry for 150.101.0.0/16, version 902222264
Paths: (2 available, best #1)
Flag: 0x820
Not advertised to any peer
7473 2914 4739 4739 4739
203.208.191.157 from 203.202.143.19 (203.202.143.19)
Origin IGP, metric 0, localpref 50, valid, internal, best
Community: 7473:21045 7473:31415 7474:1403
Originator: 203.202.143.1, Cluster list: 0.0.0.1
7473 2914 4739 4739 4739
203.208.191.157 from 203.202.143.20 (203.202.143.20)
Origin IGP, metric 0, localpref 50, valid, internal
Community: 7473:21045 7473:31415 7474:1403
Originator: 203.202.143.1, Cluster list: 0.0.0.1
No known bugs - please email me with any problems.
Mark Suter <suter@humbug.org.au>
Copyright (C) 2008 Mark Suter <suter@humbug.org.au>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.