Skip to content

Instantly share code, notes, and snippets.

@floatingstatic
Last active July 13, 2016 17:36
Show Gist options
  • Save floatingstatic/854aa504a92ab8bc3e044e434ec378c4 to your computer and use it in GitHub Desktop.
Save floatingstatic/854aa504a92ab8bc3e044e434ec378c4 to your computer and use it in GitHub Desktop.
BIRD-RTBH-Example
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;
}
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment