How can we find the as-set of asn?
For Example I have the asn:32934. I want the as-set?
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.Sign up to join this community
As I understand it, you're looking for a way to determine the set of ASNs advertised by a BGP peer, and as a result the total set of prefixes advertised by this peer, both originated from the peer ASN and its downstreams.
As far as I'm aware, there is no single source of truth for querying which BGP is peer advertising which AS-set. Three sources come to mind:
peeringDB. A lot of networks do register this information there, but there is not that much checking, so anyone can claim to advertise any set. Thanks to the peeringDB API querying this information is easy.
routing registry information (whois data) for the peer ASN. This may contain some information, mostly in freeform text as remarks, about AS-SET the peer advertises. Just as peeringDB, not really reliable since there's no verification, and harder to parse because output is not standardised.
RPSL data in routing registries. If a peer registered its routing policies in RPSL format, you may be able to determine their policy for your peering session based on what they're advertising to other peers. RPSL data is in a standardised format so it's easier to parse, but again there's no verification and also you can't be sure you can deduce the policy from other policies.
Bottomline: it's hard to get reliable data and this is hard to automate building prefix lists to filter incorrect advertisements (I guess that's your ultimate goal here?). So what can help you here?
If you have linux host, make sure bind-utils tools are installed (whois should work).
For the AS "32934" do the following: whois -h whois.radb.net AS32934 | grep mnt --> Grabs all the maintainer objects for this AS.
For each MNT object, run the whois command again. whois -h whois.radb.net !o'$MNT' | grep as-set --> This should give the list of all the AS-SETs this AS is part of. Checking for AS32934.... It seems it belongs to Facebook AS-SET.