# # Main # # Set time format for compatibility with 3rd-party programs timeformat base iso long; timeformat log iso long; timeformat protocol iso long; timeformat route iso long; # # Logging # log "/tmp/pytest-of-root/pytest-104/config0/bird.log.r1" all; debug protocols { states, routes, filters, interfaces, events }; # # Router ID # router id 0.0.0.1; # # Global Constants # # Default routes define DEFAULT_ROUTE_V4 = 0.0.0.0/0; # IPv4 default route define DEFAULT_ROUTE_V6 = ::/0; # IPv6 default route # # Device Protocol # protocol device { description "Device protocol"; scan time 10; }; # # Kernel Protocol # ipv4 table t_kernel4; ipv6 table t_kernel6; protocol kernel kernel4 { description "Kernel protocol for IPv4"; metric 600; # Set the BIRD metric to be used when creating kernel routes to fall in line with our OS learn; # Learn routes from the kernel persist; # Dont remove routes on BIRD shutdown merge paths on; # Merge similar BGP paths into a multi-hop ipv4 { table t_kernel4; export all; import all; }; }; protocol kernel kernel6 { description "Kernel protocol for IPv6"; metric 600; # Set the BIRD metric to be used when creating kernel routes to fall in line with our OS learn; # Learn routes from the kernel persist; # Dont remove routes on BIRD shutdown merge paths on; # Merge similar BGP paths into a multi-hop ipv6 { table t_kernel6; export all; import all; }; }; # # Master Tables # filter f_master_kernel4_export { # Export static routes to kernel if (source = RTS_STATIC) then { accept; } # Export static device routes to kernel if (source = RTS_STATIC_DEVICE) then { accept; } # Export RIP routes to kernel if (source = RTS_RIP) then { accept; } # Export OSPF routes to kernel if (source ~ [RTS_OSPF, RTS_OSPF_IA, RTS_OSPF_EXT1, RTS_OSPF_EXT2]) then { accept; } # Export BGP routes to kernel if (source = RTS_BGP) then { accept; } reject; }; filter f_master_kernel6_export { # Export static routes to kernel if (source = RTS_STATIC) then { accept; } # Export static device routes to kernel if (source = RTS_STATIC_DEVICE) then { accept; } # Export RIP routes to kernel if (source = RTS_RIP) then { accept; } # Export OSPF routes to kernel if (source ~ [RTS_OSPF, RTS_OSPF_IA, RTS_OSPF_EXT1, RTS_OSPF_EXT2]) then { accept; } # Export BGP routes to kernel if (source = RTS_BGP) then { accept; } reject; }; filter f_master_kernel4_import { # Accept all routes from the kernel, always if (source = RTS_INHERIT) then { accept; } reject; }; filter f_master_kernel6_import { # Accept all routes from the kernel, always if (source = RTS_INHERIT) then { accept; } reject; }; protocol pipe p_master4_to_kernel4 { description "Pipe from master4 to t_kernel4"; table master4; peer table t_kernel4; export filter f_master_kernel4_export; import filter f_master_kernel4_import; }; protocol pipe p_master6_to_kernel6 { description "Pipe from master6 to t_kernel6"; table master6; peer table t_kernel6; export filter f_master_kernel6_export; import filter f_master_kernel6_import; }; # # Static Protocol # ipv4 table t_static4; ipv6 table t_static6; protocol static static4 { description "Static protocol for IPv4"; debug all; ipv4 { table t_static4; export none; import all; }; route 192.168.20.0/24 via "eth1"; }; protocol static static6 { description "Static protocol for IPv6"; ipv6 { table t_static6; export none; import all; }; route fc20::/64 via "eth1"; }; protocol pipe p_static4_to_master4 { description "Pipe from t_static4 to master4"; table t_static4; peer table master4; export all; import none; }; protocol pipe p_static6_to_master6 { description "Pipe from t_static6 to master6"; table t_static6; peer table master6; export all; import none; }; # # RIP Protocol # # RIP Tables ipv4 table t_rip4; ipv6 table t_rip6; filter f_rip_export4 { # Redistribute static device routes if (source = RTS_STATIC_DEVICE) then { accept; } # Redistribute RIP routes if (source = RTS_RIP) then { accept; } reject; }; filter f_rip_export6 { # Redistribute static device routes if (source = RTS_STATIC_DEVICE) then { accept; } # Redistribute RIP routes if (source = RTS_RIP) then { accept; } reject; }; filter f_rip_import4 { # Import all RIP routes by default accept; }; filter f_rip_import6 { # Import all RIP routes by default accept; }; filter f_rip_master4_export { # Do not export default route to master if (net = 0.0.0.0/0) then { reject; } # Only export RIP routes o the master table if (source = RTS_RIP) then { accept; } # Reject everything else; reject; }; filter f_rip_master6_export { # Do not export default route to master if (net = ::/0) then { reject; } # Only export RIP routes o the master table if (source = RTS_RIP) then { accept; } # Reject everything else; reject; }; filter f_rip_master4_import { print "rip to master"; print source; # Import static device routes into RIP (redistribute static_device) if (source = RTS_STATIC_DEVICE) then { accept; } reject; }; filter f_rip_master6_import { print "rip to master"; print source; # Import static device routes into RIP (redistribute static_device) if (source = RTS_STATIC_DEVICE) then { accept; } reject; }; protocol rip rip4 { description "RIP protocol for IPv4"; ipv4 { table t_rip4; export filter f_rip_export4; import filter f_rip_import4; }; interface "eth0" { update time 5; metric 2; }; }; protocol rip ng rip6 { description "RIP protocol for IPv6"; ipv6 { table t_rip6; export filter f_rip_export6; import filter f_rip_import6; }; interface "eth0" { update time 5; metric 2; }; }; protocol pipe p_rip4_to_master4 { description "Pipe from t_rip4 to master4"; table t_rip4; peer table master4; export filter f_rip_master4_export; import filter f_rip_master4_import; }; protocol pipe p_rip6_to_master6 { description "Pipe from t_rip6 to master6"; table t_rip6; peer table master6; export filter f_rip_master6_export; import filter f_rip_master6_import; };