router id 1.2.3.4 define ASPUB = 12345; define ASPRV = 4200000000; filter private_in prefix set private_networks; { private_networks = [ 1.1.1.0/24+, 2.2.2.0/24+ ]; if (net ~ private_networks) then accept; reject; } filter public_in prefix set public_networks; { public_networks = [ 3.3.0.0/16+, 0.0.0.0/0 ]; if (net ~ public_networks) then accept; reject; } filter private_out prefix set private_networks; { private_networks = [ 0.0.0.0/0 ]; if (source = RTS_BGP && net ~ private_networks) then accept; reject; } filter public_out prefix set public_networks; { public_networks = [ 1.1.1.0/24+, 2.2.2.0/24+ ]; bgp_path.empty; bgp_path.prepend(ASPUB); if (source = RTS_BGP && net ~ public_networks) then accept; reject; } protocol kernel { scan time 5; import none; export all; } protocol device { scan time 10; } protocol bgp public { local as ASPUB; neighbor 1.2.3.5 as 54321; next hop self; export filter public_out; import filter public_in; }; protocol bgp private { local as ASPRV; neighbor 10.11.12.13 as 4200000001; next hop self; export filter private_out; import filter private_in; };