前些年一直想搞,一直精神状态不行, 现在有现成了的,等有空研究下,把这几年的亏空全部补上来。
项目地址https://github.com/floreabogdan/birdy
现在安装包 https://github.com/floreabogdan/birdy/releases/tag/v0.6.0
大致备忘录
yum install https://github.com/floreabogdan/birdy/releases/download/v0.6.0/birdy-0.6.0-1.x86_64.rpm
sudo -u birdy birdy init --db /var/lib/birdy/birdy.db --asn <YOUR_ASN> --router-id <ROUTER_IP>
sudo systemctl enable --now birdy
#127.0.0.1:8080 转发地址
#Next: run "birdy doctor" to check BIRD connectivity, then "birdy server".
另外用IXP Manager管理方案也可以
centos8上epel源码仓只有2.0.8可以装,只能编译安装了
yum install -y flex bison readline-devel ncurses-devel flex make
wget https://bird.network.cz/download/bird-1.6.8.tar.gz -O - | tar xz
cd bird-1.6.8
./configure --prefix=/ --bindir=/
make
bird实例
log syslog all;
debug protocols off;
debug commands 0;
router id 1.1.1.1;
protocol static rtbh {
route 99.99.99.99/32 blackhole;
route 88.88.88.88/32 blackhole;
}
filter export_rtbh_out {
# Limit to static routes
if (proto = "rtbh") then
{
# Limit to /32 host routes (for now)
if net.len = 32 then
{
bgp_community.add((65001,9999));
bgp_next_hop = 192.0.2.1;
accept;
}
}
reject;
}
protocol bgp ER3 {
description "iBGP to Edge Router 3 for RTBH";
debug { states, events };
local 1.1.1.1 as 65001;
neighbor 3.3.3.3 as 65001;
import none;
export filter export_rtbh_out;
}
protocol bgp ER4 {
description "iBGP to Edge Router 4 for RTBH";
debug { states, events };
local 1.1.1.1 as 65001;
neighbor 4.4.4.4 as 65001;
import none;
export filter export_rtbh_out;
}
JUNOS 配置实例
routing-options {
static {
route 192.0.2.1/32 discard;
}
}
protocols {
bgp {
group RTBH {
type internal;
import import-from-rs;
expor deny-all;
neighbor 1.1.1.1;
}
}
}
policy-options {
policy-statement deny-all {
term 1 {
then reject;
}
}
policy-statement import-from-rs {
term 1 {
from {
community RTBH;
route-filter 0.0.0.0/0 prefix-length-range /32-/32;
}
then accept;
}
term reject {
then reject;
}
}
community RTBH members 65001:9999;
}
抄录自https://gist.github.com/floatingstatic/854aa504a92ab8bc3e044e434ec378c4