hadiasghari / pyasn

Python IP address to Autonomous System Number lookup module. (Supports fast local lookups, and historical lookups using archived BGP dumps.)
Other
294 stars 72 forks source link

PYASN use for private enterprise BGP #61

Closed netwninja closed 5 years ago

netwninja commented 5 years ago

I'm trying to setup pyasn for private BGP AS and prefix co relation. I tried tweaking the prefix database downloaded from internet by adding RFC1918 prefixes and private AS numbers. however, it didn't work.

Is it possible to use pyasn for private BGP setup ? If yes, is there a doc available using which we can try to create a private BGP AS and Prefix database ?

Thanks GS

hadiasghari commented 5 years ago

Hi @netwninja, the MRT parser discards private BGP ASes when parsing the AS Path, as they cause wrong identification of origin AS for normal use cases. You would need to change pyasn's code for your purpose. Have a look at the is_asn_bogus function in mrtx.py.