Invalids

Invalids #

The invalids handler will return all the invalid prefixes originated by an ASN.

Invalids is unique in which the query will fetch all current invalids. You’ll then be able to iterate through the response to check for invalids from any specific ASN. Note that prefixes returned will be in the ipaddress format.

c = bgpstuff.Client()

c.get_invalids()
if c.invalids(262186):
    print(f"AS262186 is originating the following invalids:")
    for invalid in c.invalids(262186):
        print(invalid)
AS262186 is originating the following invalids
45.65.136.0/24
45.65.137.0/24
45.65.138.0/24
45.65.139.0/24
2803:9460::/32

print(f"AS15169 is originating the following invalids: {c.invalids(15169)}")
AS15169 is originating the following invalids: None
TODO