|
@@ -32,10 +32,10 @@ function bgp_import( int AS; string import_type; int community)
|
|
|
if import_type = "peering" && import_type = "transit" then {
|
|
|
if is_within_gitoyen() then return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
# On n'accepte pas les routes autres que celles definies pour les membres
|
|
|
if import_type = "member" && ! is_net_from_member(AS) then return false;
|
|
|
-
|
|
|
+
|
|
|
# Gestion des local pref par defaut
|
|
|
if import_type = "transit" then bgp_local_pref=100;
|
|
|
if import_type = "peering" then bgp_local_pref=1000;
|
|
@@ -43,9 +43,9 @@ function bgp_import( int AS; string import_type; int community)
|
|
|
|
|
|
|
|
|
# Nettoyage des communautes (On ne garde que les communautes que Gitoyen va traiter)
|
|
|
- if import_type = "transit" then bgp_community.delete( [(20766,*)] );
|
|
|
- if import_type = "peering" then bgp_community.delete( [(20766,*)] );
|
|
|
- if import_type = "membre" then bgp_community.filter( [(20766,9999)] );
|
|
|
+ if import_type = "transit" then bgp_community.delete( [(20766,*)] );
|
|
|
+ if import_type = "peering" then bgp_community.delete( [(20766,*)] );
|
|
|
+ if import_type = "membre" then bgp_community.filter( [(20766,9999)] );
|
|
|
|
|
|
# Ajout d'une communaute pour identifier la source de la route
|
|
|
if import_type != "core" && community > 0 then bgp_community.add((20766,community));
|
|
@@ -77,17 +77,17 @@ pair set full_export_communities;
|
|
|
if is_default() && ! (export_type="default") then return false;
|
|
|
|
|
|
# Filtrage des exports des routes des membres
|
|
|
- members_export_communities = [
|
|
|
+ members_export_communities = [
|
|
|
(20766,1),
|
|
|
(20766,9999),
|
|
|
(20766,40000..49999),
|
|
|
(20766,50000..59999)
|
|
|
];
|
|
|
- if export_type = "members"
|
|
|
+ if export_type = "members"
|
|
|
&& filter(bgp_community, members_export_communities).len = 0 then return false;
|
|
|
|
|
|
# Filtrage des exports de la full view
|
|
|
- full_export_communities = [
|
|
|
+ full_export_communities = [
|
|
|
(20766,1),
|
|
|
(20766,9999),
|
|
|
(20766,10000..19999),
|
|
@@ -96,15 +96,15 @@ pair set full_export_communities;
|
|
|
(20766,40000..49999),
|
|
|
(20766,50000..59999)
|
|
|
];
|
|
|
- if export_type = "full"
|
|
|
+ if export_type = "full"
|
|
|
&& filter(bgp_community, full_export_communities).len = 0 then return false;
|
|
|
-
|
|
|
+
|
|
|
# Filtrage pour la route par defaut
|
|
|
if export_type = "default"
|
|
|
&& ! is_default() then return false;
|
|
|
|
|
|
# Filtrage des exports pour le backbone
|
|
|
- if export_type = "core"
|
|
|
+ if export_type = "core"
|
|
|
&& source != RTS_BGP then return false;
|
|
|
|
|
|
# Gestion du blackhole
|