Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. #
  2.  
  3. #
  4. # Generated: 2020-04-03 09:19:52
  5. #
  6.  
  7. #log "/var/log/bird/rs1.log" all;
  8. log syslog all;
  9.  
  10. define routeserverasn = 1;
  11. define routeserveraddress = 192.168.2.2;
  12.  
  13.  
  14. router id 192.168.2.2;
  15.  
  16. # ignore interface up/down events
  17. protocol device { }
  18.  
  19. protocol kernel {
  20. scan time 20;
  21. ipv4 {
  22. export all;
  23. };
  24. }
  25.  
  26. # This function excludes weird networks
  27. # rfc1918, class D, class E, too long and too short prefixes
  28. function avoid_martians()
  29. prefix set martians;
  30. {
  31.  
  32. martians = [
  33. 10.0.0.0/8+,
  34. 169.254.0.0/16+,
  35. 172.16.0.0/12+,
  36. 192.0.0.0/24+,
  37. 192.0.2.0/24+,
  38. 192.168.0.0/16+,
  39. 198.18.0.0/15+,
  40. 198.51.100.0/24+,
  41. 203.0.113.0/24+,
  42. 224.0.0.0/4+,
  43. 240.0.0.0/4+,
  44. 0.0.0.0/32-,
  45. 0.0.0.0/0{25,32},
  46. 0.0.0.0/0{0,7}
  47. ];
  48.  
  49.  
  50. # Avoid RFC1918 and similar networks
  51. if net ~ martians then
  52. return false;
  53.  
  54. return true;
  55. }
  56.  
  57. function bgp_out(int peerID)
  58. {
  59. if (routeserverasn,peerID) ~ bgp_community then return false;
  60. # if (1,0) ~ bgp_community then return false;
  61. # if (0,peerID) ~ bgp_community then return false;
  62. return true;
  63. }
  64.  
  65.  
  66.  
  67.  
  68. ########################################################################################
  69. ########################################################################################
  70. #
  71. # Route Server client configuration
  72. #
  73. ########################################################################################
  74. ########################################################################################
  75.  
  76.  
  77. template bgp tb_rsclient {
  78. local as routeserverasn;
  79. source address routeserveraddress;
  80. strict bind yes;
  81.  
  82. # give RPKI-RTR a chance to start and populate
  83. # (RPKI is /really/ quick)
  84. connect delay time 30;
  85.  
  86. ipv4 {
  87. export all;
  88. };
  89.  
  90. rs client;
  91. }
  92.  
  93.  
  94.  
  95.  
  96. ########################################################################################
  97. ########################################################################################
  98. #
  99. # Route server clients
  100. #
  101. ########################################################################################
  102. ########################################################################################
  103.  
  104.  
  105. ########################################################################################
  106. ########################################################################################
  107. ###
  108. ### AS2 - TEST - VLAN Interface #2
  109.  
  110. ipv4 table t_0002_as2;
  111.  
  112.  
  113.  
  114. protocol pipe pp_0002_as2 {
  115. description "Pipe for AS2 - TEST - VLAN Interface 2";
  116. table master4;
  117. peer table t_0002_as2;
  118. import filter f_export_to_master;
  119. export where bgp_out(2);
  120. }
  121.  
  122. protocol bgp pb_0002_as2 from tb_rsclient {
  123. description "AS2 - TEST";
  124. neighbor 192.168.2.22 as 2;
  125. ipv4 {
  126. import limit 250 action restart;
  127. import all;
  128. table t_0002_as2;
  129. export where bgp_out(2);
  130. };
  131.  
  132. }
  133.  
  134.  
  135. ########################################################################################
  136. ########################################################################################
  137. ###
  138. ### AS3 - TEST1 - VLAN Interface #5
  139.  
  140. ipv4 table t_0005_as3;
  141.  
  142.  
  143. protocol pipe pp_0005_as3 {
  144. description "Pipe for AS3 - TEST1 - VLAN Interface 5";
  145. table master4;
  146. peer table t_0005_as3;
  147. import filter f_export_to_master;
  148. export where ixp_community_filter(3);
  149. }
  150.  
  151. protocol bgp pb_0005_as3 from tb_rsclient {
  152. description "AS3 - TEST1";
  153. neighbor 192.168.2.222 as 3;
  154. ipv4 {
  155. import limit 250 action restart;
  156. import all;
  157. table t_0005_as3;
  158. export all;
  159. };
  160.  
  161. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement