do anyone know how to group all AS numbers for Germany (f.example). Do they have some specific attributes to build a regular expression or something like this, something like a filter for all AS numbers from Germany. I have a list of, I think, all German ASs (via bgp.he.net) but I do not see any similarity in AS numbers to form a filter or regular expression.

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Aug 8, 2017 at 15:21

2 Answers 2


There is no country group. Germany is in the RIPE region and hence RIPE assigns the next available AS to the next company that requests that sites in the RIPE region.

Everything yellow in the following image sits in the RIPE region: http://en.wikipedia.org/wiki/File:Regional_Internet_Registries_world_map.svg

  • Thank you for your answer. Let's say that country group will be very useful for some filtering etc. Anyway, thank you.
    – ipermo
    Nov 18, 2013 at 15:12

Assuming you're happy with bgp.he.net's Germany AS list, you can write a script to add these AS numbers into a route-map (or leave it as an as-path list if you don't care as much about readability)...

ip as-path access-list 42 permit _13237$
ip as-path access-list 42 permit _3257$
ip as-path access-list 42 permit _25220$
! ... add all entries from bgp.he.net/country/DE
route-map GERMANY_ASN permit 10
 description All German ASNs, as found on http://bgp.he.net/country/DE
 match as-path 42

Once you've done this, you just need to update the router's version of as-path list 42 periodically to ensure you catch everything.

Whether it's really useful to accept someone else's definition of German AS numbers is another interesting question, but I'll assume you're happy with he.net's list.

  • Hello Mike, I just searched for a pattern that could identify ASs for a specific country (ie.Germany), like a phone numbers. The He.list is just for reference.
    – ipermo
    Nov 18, 2013 at 16:06
  • @ipermo, I am curious what problem are trying to solve with this? Nov 18, 2013 at 16:11
  • Well, it is not a real problem. It was just my curiosity on how "manipulate" specific, lets say customers for a specific region or country.
    – ipermo
    Nov 18, 2013 at 16:19
  • 1
    @ipermo the requirements are still a little unclear; what if a company had German customers, but the AS was registered to US entity. Would you still be interested in these customers? If so, I would say you're making the solution more difficult by filtering on ASNs. Nov 18, 2013 at 17:42
  • @ipermo Is this perhaps related to the Deutsche Telekom PR stunt to suggest a "Germany-Net" where traffic does not leave Germany? Trust me, it's still not a good idea. Nov 19, 2013 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.