Filtering question
Hi, I have this configuration: function bgp_filter_customer_in (prefix customer_prefix) { if ! (net ~ customer_prefix) then return false; else return true; } template bgp PEERS { local as myasn; import keep filtered; import all; export all; import limit 100 action restart; rs client; source address 2001:7f8:b1::1; } filter bgp_filter_grifon_nominoe_in { if (bgp_filter_customer_in([ 2a00:5884::/32, 2001:678:3cc::/48 ])) then { accept; } else { reject "Prefix filtered for Grifon"; } } protocol bgp bgp_grifon_nominoe from PEERS { description "Grifon nominoe"; neighbor 2001:7f8:b1::a as 204092; import filter bgp_filter_grifon_nominoe_in; } But the two announced prefixes are filtered: bird> show route filtered protocol bgp_grifon_nominoe 2a00:5884::/32 via 2001:7f8:b1::a on eth2 [bgp_grifon_nominoe 16:05:53] (100) [AS204092i] 2001:678:3cc::/48 via 2001:7f8:b1::a on eth2 [bgp_grifon_nominoe 16:05:53] (100) [AS206155i] If I just pass one prefix in the filter, this prefix is accepted, so I don’t understand why they are filtered with this configuration. Plus, I used the same syntax for the IPv4 prefixes and it works. I’m using bird 1.6.3. Thanks for your advices, -- alarig
Hi, On Mon, Mar 20, 2017 at 04:14:14PM +0100, Alarig Le Lay wrote:
Hi,
I have this configuration:
function bgp_filter_customer_in (prefix customer_prefix) {
Here you define prefix for the function ...
filter bgp_filter_grifon_nominoe_in { if (bgp_filter_customer_in([ 2a00:5884::/32, 2001:678:3cc::/48 ]))
But here you put an prefix set to the function. I think this wouldn't work. You can define an prefix set for the function: function bgp_filter_customer_in (prefix set customer_prefix) { HTH, weiti -- Tim Weippert http://weiti.org - weiti@weiti.org GPG Fingerprint - E704 7303 6FF0 8393 ADB1 398E 67F2 94AE 5995 7DD8
On lun. 20 mars 19:24:24 2017, Tim Weippert wrote:
Hi,
On Mon, Mar 20, 2017 at 04:14:14PM +0100, Alarig Le Lay wrote:
Hi,
I have this configuration:
function bgp_filter_customer_in (prefix customer_prefix) {
Here you define prefix for the function ...
filter bgp_filter_grifon_nominoe_in { if (bgp_filter_customer_in([ 2a00:5884::/32, 2001:678:3cc::/48 ]))
But here you put an prefix set to the function. I think this wouldn't work. You can define an prefix set for the function:
function bgp_filter_customer_in (prefix set customer_prefix) {
HTH, weiti
Thanks a lot, I didn’t notice this nuance. -- alarig
participants (2)
-
Alarig Le Lay -
Tim Weippert