Hats Network | LogoHats Network
BGP Communities

Region Codes

Geographic region codes used in AS203314 BGP communities for area-based routing policies across Asia-Pacific, Europe, North America, and Oceania regions.

Regions are grouped by geographic area with 2-digit codes used in community strings like 203314:130:XX and 203314:201:XX.

Usage: These codes identify geographic regions in internal communities (130:XX, 135:XX) and control communities (201:XX).

Region Code Reference

Region NameAreaCodeNotes
AsiaWest100Hong Kong, Taiwan
AsiaEast150Japan, Singapore
EuropeWest200UK, Ireland, France
EuropeEast250Germany, Netherlands, Russia
AmericasNorth300USA, Canada
AmericasSouth350Brazil, Argentina
AustraliaWest400Perth
AustraliaEast450Melbourne, Sydney
Antarctica-500Research networks

Regional Groupings

Asia (100, 150)

Asia West (100): Hong Kong, Taiwan, mainland China

Asia East (150): Japan, Korea, Singapore, Southeast Asia

Europe (200, 250)

Europe West (200): UK, Ireland, France, Benelux, Iberia

Europe East (250): Germany, DACH, Netherlands, Nordics, Eastern Europe

Americas (300, 350)

North America (300): United States, Canada, Mexico

South America (350): Brazil, Argentina, Chile, Colombia

Oceania (400, 450)

Australia West (400): Western Australia

Australia East (450): Eastern states (NSW, VIC, QLD)

Using Region Codes

In Internal Communities

Identify where a route was learned:

# Learned-in tags (set by AS203314 on routes you receive):
# (203314, 130, 100) -> Asia West
# (203314, 130, 150) -> Asia East
# (203314, 130, 300) -> North America

filter prefer_asia_west_routes_v4 {
  if (203314, 130, 100) ~ bgp_large_community then bgp_local_pref = 200;
  accept;
}

In Control Communities

Control geographic propagation:

bgp_large_community.add((203314, 2, 1)); # Disable cross-region
bgp_large_community.add((203314, 201, 300)); # Exclude North America
bgp_large_community.add((203314, 201, 200)); # Exclude Europe

Configuration Snippets (JunOS / BIRD2)

Region codes are used in large communities like 203314:201:XX (exclude region) and 203314:130:XX (learned in region). Below are minimal examples you can adapt.

Exclude North America (203314:201:300)

set policy-options community HATS-NO-NA members large:203314:201:300

set policy-options policy-statement EXPORT-TO-HATS term NO-NA from route-filter 203.0.113.0/24 exact
set policy-options policy-statement EXPORT-TO-HATS term NO-NA then community add HATS-NO-NA
set policy-options policy-statement EXPORT-TO-HATS term NO-NA then accept
set policy-options policy-statement EXPORT-TO-HATS term REJECT-ALL then reject

Prefer routes learned in Asia West (203314:130:100)

set policy-options community HATS-ASIA-W members large:203314:130:100

set policy-options policy-statement IMPORT-FROM-HATS term ASIA-W from community HATS-ASIA-W
set policy-options policy-statement IMPORT-FROM-HATS term ASIA-W then local-preference 200
set policy-options policy-statement IMPORT-FROM-HATS term ASIA-W then accept

Exclude North America (203314:201:300)

filter export_to_hats_v4 {
  if net = 203.0.113.0/24 then {
    bgp_large_community.add((203314, 201, 300));
    accept;
  }
  reject; # Safety default
}

Prefer routes learned in Asia West (203314:130:100)

filter import_from_hats_v4 {
  if (203314, 130, 100) ~ bgp_large_community then bgp_local_pref = 200;
  accept;
}

Regional Filtering Examples

Accept only Asian routes:

# Allow only Asia West and Asia East
if (community matches 203314:130:1*) then accept
else reject

Prefer local region:

# Higher local preference for Asia West
if (community matches 203314:130:100) then localpref 200
if (community matches 203314:130:150) then localpref 150
if (community matches 203314:130:300) then localpref 100

Tip: Region codes are ideal for high-level geographic traffic engineering when you don't need PoP-level granularity.

On this page