生成“非中国大陆 IP 段”的 BIRD 3 static route 片段,用来通过 iBGP 分发给 RouterOS client。
生成文件只包含 route 语句,放在 protocol static 块内 include。它不会生成完整
BIRD 配置,也不会同步 Linux kernel table。
下载 route 片段:
curl -L -o /etc/bird/noncn4.routes \
https://github.com/newcoderlife/chnroutes/releases/latest/download/noncn4.routes
curl -L -o /etc/bird/noncn6.routes \
https://github.com/newcoderlife/chnroutes/releases/latest/download/noncn6.routes在 bird.conf 里 include:
ipv4 table noncn4;
ipv6 table noncn6;
protocol static noncn_static4 {
ipv4 { table noncn4; import all; };
include "/etc/bird/noncn4.routes";
}
protocol static noncn_static6 {
ipv6 { table noncn6; import all; };
include "/etc/bird/noncn6.routes";
}
完整示例见 bird.example.conf。加载前检查:
birdc configure check
birdc configuremake generatecurl -L -o /usr/local/sbin/cron.sh \
https://raw.githubusercontent.com/newcoderlife/chnroutes/master/cron.example.sh
chmod +x /usr/local/sbin/cron.sh
(crontab -l 2>/dev/null; echo '17 * * * * /usr/local/sbin/cron.sh') | crontab -