# # ZST BGP Config # LastEdit: 2017/05/01 15:30 # log syslog all; router id 193.106.155.129; log "/var/log/bird.log" { debug, trace, info, remote, warning, error, auth, fatal, bug }; #log stderr all; #log "tmp" all; protocol device { scan time 15; } protocol kernel { export all; scan time 15; } protocol direct { interface "*"; } protocol static { route 193.106.152.0:255.255.252.0 reject; route 91.241.24.0:255.255.252.0 via 193.106.155.147; # ZCenter klasa 1 route 91.204.152.0:255.255.252.0 via 193.106.155.130; # X-Com klasa 1 route 91.226.236.0:255.255.252.0 via 193.106.155.134; # SinusNet klasa 1 route 91.228.156.0:255.255.252.0 via 193.106.155.138; # Frevay klasa 1 route 91.238.172.0:255.255.252.0 via 193.106.155.146; # ZCenter klasa 2 route 91.238.240.0:255.255.252.0 via 193.106.155.134; # MaszewoNET klasa 1 route 193.106.155.192:255.255.255.192 via 193.106.155.146; # Loonar klasa 1 route 193.106.155.176:255.255.255.240 via 193.106.155.142; # Raster klasa 1 #route 193.106.155.168:255.255.255.252 via 193.106.155.142; # Raster klasa 2 (zabrane na P2P) route 193.106.155.0:255.255.255.128 via 193.106.155.142; # Raster klasa 3 route 193.106.154.192:255.255.255.192 via 193.106.155.154; # TripleMedia klasa 1 (info.stargard) route 193.106.154.128:255.255.255.192 via 193.106.155.138; # FreVay klasa 2 route 193.106.154.0:255.255.255.128 via 193.106.155.134; # SinusNet klasa 2 route 193.106.153.128:255.255.255.128 via 193.106.155.166; # TripleMedia klasa 2 route 193.106.153.0:255.255.255.240 via 193.106.155.166; # TripleMedia klasa 3 route 193.106.152.0:255.255.255.0 via 193.106.155.166; # Wolna /24 } protocol static Blackholing { # route 91.241.24.24/32 reject; } # Scans and learns of blackhole routes from table 10, every 10 seconds table blackholes; protocol kernel blokadaBH { table blackholes; kernel table 10; scan time 15; learn; import all; export all; } # Merges kernel route table 10 into the kernel's active/master routing table protocol pipe { table master; peer table blackholes; mode transparent; import filter { print "Importing blackhole list."; accept; }; } # # START # Siedlce ITTMedia EXPORT # filter export_sdl_ittmedia { if (proto = "blokadaBH" ) then { if net.len = 32 then { bgp_community.add((62081,666)); printn "Blackhole nulling"; print net; accept; } } if net ~ [91.204.152.0/22] then accept; if net ~ [91.226.236.0/22] then accept; if net ~ [91.228.156.0/22] then accept; if net ~ [91.238.172.0/22] then accept; if net ~ [91.238.240.0/22] then accept; if net ~ [91.241.24.0/22] then accept; if net ~ [193.106.152.0/22+] then accept; reject; } # # END # # # START # Szczecin Espo EXPORT # filter ipv4_export { if (proto = "blokadaBH" ) then { if net.len = 32 then { bgp_community.add((62081,666)); printn "Blackhole nulling"; print net; accept; } } if net ~ [91.204.152.0/22] then accept; if net ~ [91.226.236.0/22] then accept; if net ~ [91.228.156.0/22] then accept; if net ~ [91.238.172.0/22] then accept; if net ~ [91.238.240.0/22] then accept; if net ~ [91.241.24.0/22] then accept; if net ~ [193.106.152.0/22+] then accept; reject; } # # END # filter bh_export { if (net ~ [ 91.204.152.0/22+, 91.226.236.0/22+, 91.228.156.0/22+, 91.238.172.0/22+, 91.238.240.0/22+, 91.241.24.0/22+, 193.106.152.0/22+ ]) then { accept; } reject; }; # # START # Warszawa GLOBAL EXPORT # filter export_wwa_global { if (proto = "blokadaBH" ) then { if net.len = 32 then { bgp_community.add((62081,666)); printn "Blackhole nulling"; print net; accept; } } if net ~ [91.204.152.0/22] then accept; if net ~ [91.226.236.0/22] then accept; if net ~ [91.228.156.0/22] then accept; if net ~ [91.238.172.0/22] then accept; if net ~ [91.238.240.0/22] then accept; if net ~ [91.241.24.0/22] then accept; if net ~ [193.106.152.0/22+] then accept; reject; } # # END # # # START # Warszawa PolMIX - EXPORT # filter export_wwa_polmix { if (proto = "blokadaBH" ) then { if net.len = 32 then { bgp_community.add((4446,666)); printn "Blackhole nulling"; print net; accept; } } if net ~ [91.204.152.0/22] then accept; if net ~ [91.226.236.0/22] then accept; if net ~ [91.228.156.0/22] then accept; if net ~ [91.238.172.0/22] then accept; if net ~ [91.238.240.0/22] then accept; if net ~ [91.241.24.0/22] then accept; if net ~ [193.106.152.0/22+] then accept; bgp_path.prepend(49190); reject; } # # END # # # START # Warszawa OpenPeering - EXPORT # filter export_wwa_op { if (proto = "blokadaBH" ) then { if net.len = 32 then { bgp_community.add((48850,666)); printn "Blackhole nulling"; print net; accept; } } if net ~ [91.226.236.0/22] then accept; if net ~ [91.228.156.0/22] then accept; if net ~ [91.238.172.0/22] then accept; if net ~ [91.241.24.0/22] then accept; if net ~ [193.106.152.0/22+ ] then accept; reject; } # # END # # # START # Katowice GLOBAL - EXPORT # filter export_kat_global { if (proto = "blokadaBH" ) then { if net.len = 32 then { bgp_community.add((50607,666)); printn "Blackhole nulling"; print net; accept; } } if net ~ [91.204.152.0/22] then accept; if net ~ [91.226.236.0/22] then accept; if net ~ [91.228.156.0/22] then accept; if net ~ [91.238.172.0/22] then accept; if net ~ [91.238.240.0/22] then accept; if net ~ [91.241.24.0/22] then accept; if net ~ [193.106.152.0/22+] then accept; bgp_path.prepend(49190); bgp_path.prepend(49190); reject; } # # END # # # START # Katowice POLMIX - EXPORT # filter export_kat_polmix { if (proto = "blokadaBH" ) then { if net.len = 32 then { bgp_community.add((4446,666)); printn "Blackhole nulling"; print net; accept; } } if net ~ [91.204.152.0/22] then accept; if net ~ [91.226.236.0/22] then accept; if net ~ [91.228.156.0/22] then accept; if net ~ [91.238.172.0/22] then accept; if net ~ [91.238.240.0/22] then accept; if net ~ [91.241.24.0/22] then accept; if net ~ [193.106.152.0/22+] then accept; reject; } # # END # # # START # Katowice OpenPeering - EXPORT # filter export_kat_op { if (proto = "blokadaBH" ) then { if net.len = 32 then { bgp_community.add((50607,666)); printn "Blackhole nulling"; print net; accept; } } if net ~ [91.204.152.0/22] then accept; if net ~ [91.238.240.0/22] then accept; if net ~ [91.228.156.0/22] then accept; if net ~ [91.238.172.0/22] then accept; if net ~ [91.241.24.0/22] then accept; if net ~ [193.106.152.0/22+] then accept; bgp_path.prepend(49190); reject; } # # END # protocol bgp WWA_EPIX_GLOBAL { description "WARSZAWA Epix GLOBAL"; import all; export filter export_wwa_global; default bgp_local_pref 100; local as 49190; neighbor 185.48.8.38 as 62081; source address 185.48.8.39; } protocol bgp WWA_EPIX_POLMIX { description "WARSZAWA Epix PolMix"; import all; export filter export_wwa_polmix; default bgp_local_pref 200; local as 49190; neighbor 94.246.185.176 as 201054; source address 94.246.185.177; } protocol bgp WWA_EPIX_OpenPeering_rs1 { description "WARSZAWA Epix Open Peering RS1"; import all; export filter export_wwa_op; default bgp_local_pref 300; local as 49190; neighbor 91.212.9.11 as 48850; source address 91.212.9.186; } protocol bgp WWA_EPIX_OpenPeering_rs2 { description "WARSZAWA Epix Open Peering RS2"; import all; export filter export_wwa_op; default bgp_local_pref 300; local as 49190; neighbor 91.212.9.12 as 48850; source address 91.212.9.186; } protocol bgp KAT_EPIX_GLOBAL { description "KATOWICE Epix Global"; import all; export filter export_kat_global; default bgp_local_pref 100; local as 49190; neighbor 176.126.59.238 as 50607; source address 176.126.59.239; } protocol bgp KAT_EPIX_POLMIX { description "KATOWICE Epix PolMix"; import all; export filter export_kat_polmix; local as 49190; neighbor 185.48.10.114 as 201054; source address 185.48.10.115; default bgp_local_pref 200; } protocol bgp KAT_EPIX_OpenPeering_rs1 { description "KATOWICE Epix Open Peering RS1"; import all; export filter export_kat_op; default bgp_local_pref 300; local as 49190; neighbor 195.191.170.1 as 50607; source address 195.191.170.149; } protocol bgp KAT_EPIX_OpenPeering_rs2 { description "KATOWICE Epix Open Peering RS2"; import all; export filter export_kat_op; default bgp_local_pref 300; local as 49190; neighbor 195.191.170.100 as 50607; source address 195.191.170.149; } protocol bgp SZCZ_eSpol_polmix { description "Szczecin eSpol POLMIX"; import all; export filter ipv4_export; default bgp_local_pref 50; local as 49190; neighbor 83.168.110.213 as 31304; source address 83.168.110.214; } protocol bgp SZCZ_eSpol_MIX { disabled; description "Szczecin eSpol MIX"; import all; export filter ipv4_export; local as 49190; neighbor 83.168.110.17 as 31304; source address 83.168.110.18; } protocol bgp SIED_ITTMedia_ORANGE { disabled; description "ITTMedia siedlce ORANGE"; import all; export filter export_sdl_ittmedia; local as 49190; neighbor 176.103.40.81 as 197447; source address 176.103.40.82; } protocol bgp BH_sesja { description "BlackHooling"; # import all; export filter bh_export; local as 49190; neighbor 172.31.32.10 as 64496; source address 172.31.32.254; }