-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
bgpd: add VRF support to RPKI #15052
Conversation
9445cb7
to
a73037b
Compare
0b2ecdb
to
795677e
Compare
0a490c6
to
35d58e6
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
35d58e6
to
07df593
Compare
07df593
to
a7a24be
Compare
a7a24be
to
e7c3df6
Compare
Could you add before and after CLI examples here? I'm wondering if there's an issue with configuring RPKI per vrf? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And yes, agree with @riw777, could you show the configuration with VRF X, and a default VRF together? No breaking changes?
doc/user/rpki.rst
Outdated
router bgp 60001 vrf vrf_connect | ||
bgp router-id 141.22.28.223 | ||
network 192.168.0.0/16 | ||
neighbor 123.123.123.0 remote-as 60002 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use documentation ranges, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
doc/user/rpki.rst
Outdated
! | ||
exit-vrf | ||
router bgp 60001 vrf vrf_connect | ||
bgp router-id 141.22.28.223 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use documentation ranges, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
bgpd/bgp_rpki.c
Outdated
|
||
for (ALL_LIST_ELEMENTS_RO(rpki_vrf_list, rpki_vrf_nnode, rpki_vrf)) { | ||
if ((!vrfname && rpki_vrf->vrfname) || | ||
(vrfname && !rpki_vrf->vrfname) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!rpki_vrf->vrfname
means this is a default VRF?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I have clarified that with a small rework and some comments
bgpd/bgp_rpki.c
Outdated
else | ||
rpki_vrf = VTY_GET_CONTEXT(rpki_vrf); | ||
|
||
if (!rpki_vrf->cache_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rpki_vrf
can be NULL, and we should check before dereferencing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
bgpd/bgp_rpki.c
Outdated
return reset(true, rpki_vrf) == SUCCESS ? CMD_SUCCESS : CMD_WARNING; | ||
} | ||
|
||
DEFUN (rpki_reset_config_mode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEFPY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
bgpd/bgp_rpki.c
Outdated
rpki_vrf = get_rpki_vrf(vrfname); | ||
|
||
if (!rpki_vrf) | ||
return CMD_SUCCESS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this really should be treated as SUCCESS...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMD_WARNING instead
RPKI stores its data in global variables. It does not allow specific date per VRF. Move global variable to a new structure named rpki_vrf and maintain a per VRF list of rpki_vrf. The changes are cosmetic because only the default VRF is supported yet. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Remove rpki config command from enable node. It cannot work. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Add a hook to call a future callback function when bgpd knows from zebra about the activation of de-activation of a VRF. It will be used by the RPKI module in next commits. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Start or stop a RPKI cache servers in VRF when they are created or deleted. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Create cache server socket in vrf Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Add a "vrf <vrfname>" argument to "show rpki" and "rpki" commands in enable mode Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Add support of RPKI commands in the VRF configure context. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Show per VRF RPKI configuration in "show run". Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Set the RPKI validation state in the VRF BGP table. It allows applying a route-maps with "match rpki <state>" on a VRF neighbor. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Add VRF name to some rpki logs Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Use documentation range in rpki manual Signed-off-by: Louis Scalbert <[email protected]>
Fix RPKI IPv4 address family example. Signed-off-by: Louis Scalbert <[email protected]>
It is not used anymore. Fixes: 2a5f5ec ("bgpd: Drop SSH public key for RPKI CLI option") Signed-off-by: Louis Scalbert <[email protected]>
Add documentation for per VRF RPKI commands Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Add "show bgp rpki prefix-count" command to show the number of received prefixes from RPKI cache servers. Signed-off-by: Philippe Guibert <[email protected]> Signed-off-by: Louis Scalbert <[email protected]>
Add vrf test to bgp_rpki_topo1 Signed-off-by: Louis Scalbert <[email protected]>
e7c3df6
to
2b30c4a
Compare
ci:rerun CI successful, but github check (hook) missed |
Add VRF support to RPKI
Re-Add #5015 that got reverted in #6740 due to rtlib lacking the required support (rtrlib/rtrlib#252).
Mentioned in #14220
This PR is not actually a draft but the topotest has a GPL-3 depedancy that needs to be solved. See #15034 (comment)