配置 BGP 会话
SerinaIX
AS4242423625
AS4242423625
在 SerinaIX 中,你至少应该与 Route Servers 建立 BGP 会话。除此之外,也可以直接与 IX 中的其他接入者建立 BGP 会话。
WARNING
别把整个 DN42 的路由表发送给 Route Server!
Route Servers
Route Server 是 eBGP 中相当于 iBGP 的 Route Reflector 的设备,简化了 IX 中所需的直接点对点 eBGP 会话数量。
以下是 SerinaIX 中的 Route Servers 列表:
| ID | IPv6 本地链路地址 | 地理位置 |
|---|---|---|
| RS1 | fe80::89:58ff:fe96:4c77 | 上海 |
| RS2 | N/A | 上海 |
前置条件
以下是必须满足的条件:
- MP-BGP
- IPv4 通道上的
extended next hop local role rs_client
以下是建议启用的功能:
- BFD
add paths rxenable extended messages
BIRD2 配置
以下是使用 BIRD2 的示例配置文件:
bird2
function IS_net_valid() -> bool{
case net.type {
NET_IP4: return is_valid_network();
NET_IP6: return is_valid_network_v6();
else: print "IS_NET_VALID: unexpected net.type ", net.type, " ", net; return false;
}
}
function IS_route_from_SerinaIX_RS() -> bool {
return bgp_large_community ~ [(4242423625, 233, *)];
}
filter Export_SerinaIX_RS {
if !IS_NET_VALID() then reject;
if IS_route_from_SerinaIX_RS() then reject;
case source {
RTS_STATIC: accept;
RTS_BGP: {
# self network: ibgp or self as from ebgp
if (bgp_path.len = 0 || bgp_path.last = OWNAS) then accept;
# optional: direct peers or downstreams
# if bgp_path.len = 1 then accept;
};
else: reject;
}
}
template bgp SerinaIX_RS from dnpeers {
local as OWNAS;
bfd;
local role rs_client;
enable extended messages;
ipv4 {
add paths rx;
extended next hop;
# use import filter from template
export filter Export_SerinaIX_RS;
};
ipv6 {
add paths rx;
# use import filter from template
export filter Export_SerinaIX_RS;
};
}
protocol bgp DN42_SerinaIX_RS1 from SerinaIX_RS {
neighbor fe80::89:58ff:fe96:4c77 % 'n2n-serinaix' as 4242423625;
}
# protocol bgp DN42_SerinaIX_RS2 from SerinaIX_RS {
# neighbor fe80:: % 'n2n-serinaix' as 4242423625;
# }1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60