Browse Source

Don't announce blackhole route to peers that don't implement RTBH

(cherry picked from commit 154c1cd49246350cacd2a53718620df27a1d887f)
Baptiste Jonglez 10 years ago
parent
commit
516e8897b8
1 changed files with 14 additions and 7 deletions
  1. 14 7
      etc/local/bird/common/bgp-filters.conf

+ 14 - 7
etc/local/bird/common/bgp-filters.conf

@@ -115,13 +115,20 @@ pair set full_export_communities;
         && source != RTS_BGP then return false;
         && source != RTS_BGP then return false;
 
 
     # blackhole management
     # blackhole management
-    case AS {
-        # Absolight
-        29608:  if filter(bgp_community, [ (20766,9999) ]).len > 0 then bgp_community.add ((29608,65001));
-        # Tata
-        6453:   if filter(bgp_community, [ (20766,9999) ]).len > 0 then bgp_community.add ((64999,0));
-        # Ielo
-        29075:  if filter(bgp_community, [ (20766,9999) ]).len > 0 then bgp_community.add ((29075,0));
+    if filter(bgp_community, [ (20766,9999) ]).len > 0 then {
+        case AS {
+            # Absolight
+            29608:  bgp_community.add ((29608,65001));
+            # Tata
+            6453:   bgp_community.add ((64999,0));
+            # Ielo
+            29075:  bgp_community.add ((29075,0));
+            # By default, don't announce a blackhole route, because it would be
+            # interpreted as a regular route.  Since it is more specific, it
+            # would attract traffic, which is precisely the opposite of the
+            # desired behaviour when blackholing...
+            else:   return false;
+        }
     }
     }
 
 
     return true;
     return true;