Skip to content

newcoderlife/chnroutes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

576 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chnroutes

生成“非中国大陆 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 configure

本地生成

make generate

自动更新

curl -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 -

数据来源

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors