Crates.io | bgpexplorer |
lib.rs | bgpexplorer |
version | 0.3.3 |
source | src |
created_at | 2021-05-04 11:29:24.856309 |
updated_at | 2023-01-17 17:26:36.950576 |
description | This is a BGP route explorer for routing information database with ability to drill-down routes change history |
homepage | |
repository | https://github.com/wladwm/bgpexplorer |
max_upload_size | |
id | 392958 |
size | 626,789 |
This is a BGP route explorer for RIB (routing information database) with ability to drill-down routes change history. It can be a BGP speaker (only listener exact) or BMP monitoring station. bgpexplorer supports many NLRI types and path attribute kinds and intened to be a looking glass and "show route" replacement. It is replacement for old BGPHist (https://sourceforge.net/projects/bgphist/). bgpexplorer is much more fast, beacause it store RIBs with history in the RAM. RIB can be accessed via http protocol in JSON format. For your convinience bgpexplorer serves bundled files to provide basic web service, which can be used as backend for front web server (nginx or apache for example) with AAA. All json endpoints located under /api/ URI.
At first you will need at least a BGP router to monitor :-). And some PC with Linux/FreeBSD (although Windows or Mac will work too, I hope).
At second you should configure your router to accept bgp connections from your PC. For example, router you have has IP 10.0.0.1, AS 65535. PC with bgpexplorer has IP 10.1.1.1. In Cisco dialect it will be something like:
router bgp 65535
! create a neighbor with your own AS, so it will be IBGP
neighbor 10.1.1.1 remote-as 65535
! specify source IP
neighbor 10.1.1.1 update-source Loopback0
! do not attempt to connect from router to PC, only from PC to router
neighbor 10.1.1.1 transport connection-mode passive
address-family ipv4
! it has ipv4 unicast address family
neighbor 10.1.1.1 activate
! send all routing information to PC
neighbor 10.1.1.1 route-reflector-client
! activate ipv4 labeled-unicast address family
neighbor 10.1.1.1 send-label
address-family vpnv4
! activate vpnv4 unicast address family
neighbor 10.1.1.1 activate
neighbor 10.1.1.1 send-community extended
Now on PC with Linux or FreeBSD:
$ git clone https://github.com/wladwm/bgpexplorer
... git messages
$ cd bgpexplorer
$ cargo build
... cargo messages
$ cat > bgpexplorer.ini <<EOF
[main]
httplisten=0.0.0.0:8080
httproot=contrib
whoisjsonconfig=whois.json
snapshot=snapshot.bgp
[s0]
mode=bgpactive
peer=10.0.0.1
peeras=65535
EOF
$ cargo run
After this you should see something like:
Listening on http://0.0.0.0:8080
BGP trying 10.0.0.1:179
Connected to 10.0.0.1:179
After this you can open your favorite browser and point to http://10.1.1.1:8080/ - you should see bgpexplorer basic interface.
For example view for ipv4 unicast:
Or vpnv4 unicast:
bgpexplorer looks for configuration in file bgpexplorer.ini in current directory. This file should have [main] section and peer sections with any other names Main section parameters:
Service section parameters:
BTW, builtin whois proxy allows you to see some info about AS and hosts:
https://crates.io/crates/bgpexplorer