snar / bgpq3

bgpq3
BSD 2-Clause "Simplified" License
363 stars 53 forks source link

Feature Request: Do not print anything if 0 objects received #56

Open abaluta opened 4 years ago

abaluta commented 4 years ago

RADb does not give data sometimes. This happens very rarely (once a month) , so I can’t find the exact cause.

Is it possible not to print a standard template, if bgp3 got 0 networks? Now I get (if the problem happened)

bgpq3 -J -S radb,ripe -l Client AS-CLIENT
  policy-options {
    replace:
      prefix-list Client {
      }
  }

And the client without networks :(

snar commented 4 years ago

On Sat, Feb 01, 2020 at 12:22:01PM -0800, abaluta wrote:

RADb does not give data sometimes. This happens very rarely (once a month) , so I can’t find the exact cause.

Is it possible not to print a standard template, if bgp3 got 0 networks?

Can you please explain what do you mean by "standard template" ? Second question: let's assume AS-CLIENT contains N autonomous systems, RADB returns some prefixes for K of them and zero prefixes for the rest. What shall be generated in this case: some kind of warning/"standard template" or normal prefix-list ?

Now I get (if the problem happened) bgpq3 -J -S radb,ripe -l Client AS-CLIENT policy-options { replace: prefix-list Client { } } And the client without networks :(

To avoid uploading empty prefix-lists to routers in automatical mode, you may introduce step of checking "if generated prefix-list is empty (generated file is five lines long) then do not upload it to routers" in your prefix-list update system.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.*

abaluta commented 4 years ago

Can you please explain what do you mean by "standard template" ? ... To avoid uploading empty prefix-lists to routers in automatical mode, you may introduce step of checking "if generated prefix-list is empty (generated file is five lines long) then do not upload it to routers" in your prefix-list update system.

For the juniper these are these 5 lines, for Cisco 3 lines. It seems to me that focusing on the number of lines is not ideal. May be add additional exit codes? For example: 2 - If the number of networks received in any object (parent or child) 0. 3 - If number of AS in as-set 0 and other...

snar commented 4 years ago

On Sun, Feb 02, 2020 at 09:57:53AM -0800, abaluta wrote:

Can you please explain what do you mean by "standard template" ?
...
To avoid uploading empty prefix-lists to routers in automatical mode,
you may introduce step of checking "if generated prefix-list is empty
(generated file is five lines long) then do not upload it to routers"
in your prefix-list update system.

For the juniper these are these 5 lines, for Cisco 3 lines.

If you generating filters for different vendors, your tool is already aware about vendor specifics (else it will call bgpq3 with wrong vendor option). Extending this knowledge to the step of checking "generated prefix-list is empty" shall not be a problem..

It seems to me that focusing on the number of lines is not ideal. May be add additional exit codes? For example: 2 - If the number of networks received in any object (parent or child) 0. 3 - If number of AS in as-set 0 and other...

On any level of recursion ? Say, you build filter for AS-CUSTOMER, which includes AS111 (customer itself), AS222 (customer of your customer) and AS-ANOTHER-CUSTOMER. Shall bgpq3 fail in case when AS222 or some AS included in AS-ANOTHER-CUSTOMER becomes empty ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.*

abaluta commented 4 years ago

On any level of recursion ?

Yes. I understand that there will be many false positives. Of course, this should be enabled by the option. (It’s a pity that -p_aranoiac is busy) It is not very scary to run in automatic mode with this option.

If it is difficult, I will count the lines.