Skip to content

Instantly share code, notes, and snippets.

@floatingstatic
Last active July 13, 2016 17:36
Show Gist options
  • Select an option

  • Save floatingstatic/854aa504a92ab8bc3e044e434ec378c4 to your computer and use it in GitHub Desktop.

Select an option

Save floatingstatic/854aa504a92ab8bc3e044e434ec378c4 to your computer and use it in GitHub Desktop.

Revisions

  1. floatingstatic renamed this gist Jul 13, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. floatingstatic revised this gist Jul 13, 2016. 1 changed file with 37 additions and 0 deletions.
    37 changes: 37 additions & 0 deletions juniper-mx-exmaple
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    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;
    }
  3. floatingstatic revised this gist Jul 13, 2016. 1 changed file with 0 additions and 48 deletions.
    48 changes: 0 additions & 48 deletions bird.conf
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,3 @@
    #########################################
    # bird.conf example #
    #########################################

    log syslog all;
    debug protocols off;
    debug commands 0;
    @@ -43,48 +39,4 @@ protocol bgp ER4 {
    neighbor 4.4.4.4 as 65001;
    import none;
    export filter export_rtbh_out;
    }



    #########################################
    # Juniper MX peer example #
    #########################################

    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;
    }
  4. floatingstatic renamed this gist Jul 13, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. floatingstatic revised this gist Jul 13, 2016. No changes.
  6. floatingstatic created this gist Jul 13, 2016.
    90 changes: 90 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,90 @@
    #########################################
    # bird.conf 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;
    }



    #########################################
    # Juniper MX peer example #
    #########################################

    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;
    }