BGP Communities / BGP 社区
Our BGP communities in DN42 / 我们在 DN42 中的 BGP 社区
We adopted the BGP community settings recommended in the DN42 Wiki. At the same time, we recommend that other networks deploy similar strategies.
我们采用了 DN42 Wiki 中推荐的 BGP 社区设置。同时,我们建议其他网络部署类似的策略。

1: Continent / 大洲 (Internal Use / 内部使用)

  • (207268, 1, 41) :: Europe / 欧洲
  • (207268, 1, 42) :: North America-E / 北美东部
  • (207268, 1, 43) :: North America-C / 北美中部
  • (207268, 1, 44) :: North America-W / 北美西部
  • (207268, 1, 45) :: Central America / 中美洲
  • (207268, 1, 46) :: South America-E / 南美洲东部
  • (207268, 1, 47) :: South America-W / 南美洲西部
  • (207268, 1, 48) :: Africa-N (above Sahara) / 撒哈拉以北非洲
  • (207268, 1, 49) :: Africa-S (below Sahara) / 撒哈拉以南非洲
  • (207268, 1, 50) :: Asia-S (IN,PK,BD) / 南亚
  • (207268, 1, 51) :: Asia-SE (TH,SG,PH,ID,MY) / 东南亚
  • (207268, 1, 52) :: Asia-E (JP,CN,KR) / 东亚
  • (207268, 1, 53) :: Pacific / 太平洋

1*: Auto Translation / 自动转换

The provided DN42 community will rewrite the above rules.
提供的DN42 community将会重写以上规则。
  • (64511, 41) :: Europe
  • (64511, 42) :: North America-E
  • (64511, 43) :: North America-C
  • (64511, 44) :: North America-W
  • (64511, 45) :: Central America
  • (64511, 46) :: South America-E
  • (64511, 47) :: South America-W
  • (64511, 48) :: Africa-N (above Sahara)
  • (64511, 49) :: Africa-S (below Sahara)
  • (64511, 50) :: Asia-S (IN,PK,BD)
  • (64511, 51) :: Asia-SE (TH,SG,PH,ID,MY)
  • (64511, 52) :: Asia-E (JP,CN,KR)
  • (64511, 53) :: Pacific

2: Local Pref

  • (207268, 2, 1) :: bgp_local_pref = 100
  • (207268, 2, 2) :: bgp_local_pref = 200
  • (207268, 2, 3) :: bgp_local_pref = 0

3: Rule Control / 规则控制

  • Internet eXchange Routes / 互联网交换点路由
    • (207268, 3, 10) :: No-export Downstream Routes (Default) / 不对外宣告下游路由 (默认)
      • local_pref - 1
    • (207268, 3, 11) :: Force-export Downstream Routes / 强制对外宣告下游路由
  • China Mainland Routes / 中国大陆路由
    • (207268, 3, 20) :: Comes from China Mainland / 来自中国大陆

Local Pref

Our local preference will be calculated by the following formula:
我们的 local preference 将通过下列公式计算:
1
if REGION = 41 then {
2
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 150;
3
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 140;
4
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 130;
5
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 120;
6
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 120;
7
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 120;
8
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 110;
9
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 130;
10
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 120;
11
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 110;
12
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 110;
13
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 110;
14
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 100;
15
}
16
if REGION = 42 then {
17
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 140;
18
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 150;
19
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 140;
20
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 130;
21
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 130;
22
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 120;
23
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 120;
24
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 120;
25
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 110;
26
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 100;
27
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 100;
28
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 100;
29
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 110;
30
}
31
if REGION = 43 then {
32
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 130;
33
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 140;
34
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 150;
35
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 140;
36
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 130;
37
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 120;
38
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 120;
39
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 110;
40
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 100;
41
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 120;
42
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 120;
43
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 120;
44
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 130;
45
}
46
if REGION = 44 then {
47
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 120;
48
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 130;
49
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 140;
50
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 150;
51
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 130;
52
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 120;
53
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 120;
54
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 110;
55
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 100;
56
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 120;
57
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 120;
58
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 120;
59
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 130;
60
}
61
if REGION = 45 then {
62
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 120;
63
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 130;
64
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 130;
65
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 130;
66
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 150;
67
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 140;
68
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 140;
69
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 120;
70
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 110;
71
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 120;
72
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 120;
73
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 120;
74
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 130;
75
}
76
if REGION = 46 then {
77
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 120;
78
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 120;
79
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 120;
80
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 120;
81
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 140;
82
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 150;
83
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 140;
84
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 130;
85
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 120;
86
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 110;
87
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 110;
88
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 110;
89
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 120;
90
}
91
if REGION = 47 then {
92
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 110;
93
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 120;
94
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 120;
95
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 120;
96
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 140;
97
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 140;
98
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 150;
99
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 120;
100
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 110;
101
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 120;
102
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 120;
103
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 120;
104
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 130;
105
}
106
if REGION = 48 then {
107
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 130;
108
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 120;
109
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 110;
110
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 110;
111
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 120;
112
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 130;
113
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 120;
114
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 150;
115
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 140;
116
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 110;
117
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 110;
118
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 110;
119
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 100;
120
}
121
if REGION = 49 then {
122
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 120;
123
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 110;
124
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 100;
125
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 100;
126
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 110;
127
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 120;
128
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 110;
129
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 140;
130
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 150;
131
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 110;
132
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 110;
133
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 110;
134
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 100;
135
}
136
if REGION = 50 then {
137
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 110;
138
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 100;
139
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 110;
140
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 120;
141
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 120;
142
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 110;
143
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 120;
144
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 110;
145
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 110;
146
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 150;
147
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 140;
148
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 140;
149
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 130;
150
}
151
if REGION = 51 then {
152
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 110;
153
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 100;
154
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 110;
155
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 120;
156
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 120;
157
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 110;
158
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 120;
159
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 110;
160
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 110;
161
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 140;
162
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 150;
163
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 140;
164
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 130;
165
}
166
if REGION = 52 then {
167
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 110;
168
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 100;
169
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 110;
170
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 120;
171
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 120;
172
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 110;
173
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 120;
174
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 110;
175
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 110;
176
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 140;
177
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 140;
178
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 150;
179
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 130;
180
}
181
if REGION = 53 then {
182
if (OWNAS, 1, 41) ~ bgp_large_community then bgp_local_pref = 100;
183
if (OWNAS, 1, 42) ~ bgp_large_community then bgp_local_pref = 110;
184
if (OWNAS, 1, 43) ~ bgp_large_community then bgp_local_pref = 120;
185
if (OWNAS, 1, 44) ~ bgp_large_community then bgp_local_pref = 130;
186
if (OWNAS, 1, 45) ~ bgp_large_community then bgp_local_pref = 130;
187
if (OWNAS, 1, 46) ~ bgp_large_community then bgp_local_pref = 120;
188
if (OWNAS, 1, 47) ~ bgp_large_community then bgp_local_pref = 130;
189
if (OWNAS, 1, 48) ~ bgp_large_community then bgp_local_pref = 100;
190
if (OWNAS, 1, 49) ~ bgp_large_community then bgp_local_pref = 100;
191
if (OWNAS, 1, 50) ~ bgp_large_community then bgp_local_pref = 130;
192
if (OWNAS, 1, 51) ~ bgp_large_community then bgp_local_pref = 130;
193
if (OWNAS, 1, 52) ~ bgp_large_community then bgp_local_pref = 130;
194
if (OWNAS, 1, 53) ~ bgp_large_community then bgp_local_pref = 150;
195
}
196
if (OWNAS, 3, 10) ~ bgp_large_community then bgp_local_pref = bgp_local_pref - 1;
197
bgp_local_pref = bgp_local_pref - bgp_path.len * 15;
Copied!
Last modified 9mo ago