-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbird.conf
73 lines (62 loc) · 1.72 KB
/
bird.conf
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
61
62
63
64
65
66
67
68
69
70
71
72
73
# 写在前面:
# 请务必阅读全部文件并根据需要修改所有 <> 项目
# 模板外修改请注意阅读手册
# 默认使用 IGP 重分发模式并限制可以重分发的网段,设置时请认真,避免漏表
# 可以根据需要裁剪引入文件及相关表
log syslog all;
# off it when it works well
debug protocols all;
# set your info here
define LOCAL_ASN = <your_ASN>;
define LOCAL_CIDR = <local_cidr>;
define SERVE_IP = <local_serve_ip>;
define TUNNEL_IP = <local_tunnel_ip>;
router id SERVE_IP;
protocol device {}
protocol kernel{
ipv4 {
import none;
export filter {
if net = LOCAL_CIDR then reject;
if net ~ [ 10.0.0.0/8{16,32}, 100.64.0.0/10{24,32}, 172.16.0.0/12{24,32}, 192.168.0.0/16{24,32} ] then {
krt_prefsrc = SERVE_IP;
accept;
}
reject;
};
};
}
include "/etc/bird/bfd.conf";
ipv4 table OSPF_table;
include "/etc/bird/ospf.conf";
ipv4 table BGP_table;
roa4 table dn11_roa4;
include "/etc/bird/ebgp.conf";
include "/etc/bird/ibgp.conf";
protocol pipe pipe_ospf_table{
table master4;
peer table OSPF_table;
import all;
export none;
}
protocol pipe pipe_bgp_ospf_table {
table BGP_table;
peer table OSPF_table;
import filter {
if net = LOCAL_CIDR || source = RTS_STATIC then bgp_med = 0;
else bgp_med = 50;
# cidr example: 192.168.0.0/24+
if net ~ [ <your_cidr>, <your_cidr2_if_present> ] then accept;
reject;
};
export none;
}
protocol pipe pipe_bgp_table {
table master4;
peer table BGP_table;
import filter {
if source != RTS_BGP then reject;
accept;
};
export none;
}