Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for frr ? #96

Open
opsec opened this issue Jun 10, 2023 · 11 comments
Open

Support for frr ? #96

opsec opened this issue Jun 10, 2023 · 11 comments

Comments

@opsec
Copy link

opsec commented Jun 10, 2023

Is there a plan to support frr syntax ?

https://frrouting.org/

The syntax is very similar to cisco, but some differences exist.

@job
Copy link
Member

job commented Jun 10, 2023

Can you articulate the differences and perhaps provide a patch via a pull-request?

@gabrieltackitt
Copy link

Not the OP, but I use Vyos (which is Frr under the hood). The one major thing that I've found bgpq4 can't do that would be a big help for both FRR and Vyos is a way to sequence prefix lists.

FRR prefix list syntax is this:

ipv6 prefix-list SAMPLE-TITLE seq 1 permit 2001:db8::/32 ge 48 le 48

Vyos syntax is for one prefix item is:

set policy prefix-list SAMPLE-TITLE rule 1 prefix 2001:db8::/32
set policy prefix-list SAMPLE-TITLE rule 1 action permit
set policy prefix-list SAMPLE-TITLE rule 1 le 48
set policy prefix-list SAMPLE-TITLE rule 1 ge 32

I currently use the following to generate a custom format in bgpq4 and then go and manually change the ### into rule numbers.

-F "set rule ### action permit\nset rule ### prefix %n/%l\nset rule ### ge %A\nset rule ### le %a\n\n"

Even if not a fully supported format, I would love to see a way to sequence rules with numbers added into the custom format options.

peterablehmann added a commit to peterablehmann/bgpq4 that referenced this issue Feb 22, 2025
@peterablehmann
Copy link

Hi, I have added support for FRRouting prefix lists in #126. I would appreciate if you have the time to review the changes.

@opsec
Copy link
Author

opsec commented Feb 22, 2025

Thanks, it looks very good, but newer versions of frr have numbered prefix lists, like this:

ip prefix-list NN seq 10 permit 192.168.10.0/24
ip prefix-list NN seq 20 permit 192.168.16.0/22

Any chance to add those seq numbers ?

@opsec
Copy link
Author

opsec commented Feb 22, 2025

I'm playing with the code and might have some quick-and-dirty answer.

@opsec
Copy link
Author

opsec commented Feb 22, 2025

The patches to main.c and printer.c modified to add sequence numbers see:

https://people.freebsd.org/~pi/bgpq4/patch-main.c
https://people.freebsd.org/~pi/bgpq4/patch-printer.c

@opsec
Copy link
Author

opsec commented Feb 22, 2025

And: bgpq4_print_frr_prefixlist() in printer.c is probably not needed, as bgpq4_print_cisco_prefixlist() works for frr.

@opsec
Copy link
Author

opsec commented Feb 22, 2025

The links above are extended to also support sequence numbers in frr as-path.

@opsec
Copy link
Author

opsec commented Feb 22, 2025

example:

bgpq4 -W 2 -Zsf 12502 AS-NEPUSTIL

@peterablehmann
Copy link

Thank you for the patches, I will take a look.

@peterablehmann
Copy link

I have added support for sequenced prefix lists. I'm not familiar with the as-path list, therefor I will not include it in my PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants