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

bgp: T2100: Changing RFC8212 behavior and option toggle #744

Merged
merged 1 commit into from Feb 26, 2021
Merged

bgp: T2100: Changing RFC8212 behavior and option toggle #744

merged 1 commit into from Feb 26, 2021

Conversation

Cheeze-It
Copy link
Contributor

@Cheeze-It Cheeze-It commented Feb 26, 2021

In this commit we add the default operation within BGP
to have RFC8212 disabled for eBGP routes. This default
should preserve the normal behavior for VyOS from earlier
releases of FRR to the current latest release. Another
option that we add is the ability to toggle whether or
not RFC8212 is enabled or disabled.

Change Summary

This commit changes the default behavior for VyOS to match up to pre-FRR 7.4/7.5 functionality by
changing the RFC8212 operation that has been added to FRR 7.4/7.5. Now it is disabled by default
and allows for an option to enable this functionality by adding it within the parameters stanza. That is
the second portion of the commit is adding the ability to enable/disable RFC8212 functionality with
a command under parameters. Lastly, I added the smoketest for this so that it always gets tested.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

T2100, T3183

Component(s) name

BGP

Proposed changes

Please see above. There's really not much more detail than this.

How to test

This was tested within a VyOS VM.

Normally configuring BGP without this option we see:

vyos@vyos:~$ vtysh -c "show run bgp"
Building configuration...

Current configuration:
!
frr version 7.5-20210212-00-gbc460d132
frr defaults traditional
hostname vyos
service integrated-vtysh-config
!
router bgp 1
 no bgp ebgp-requires-policy
 no bgp network import-check
!
line vty
!
end
vyos@vyos:~$
vyos@vyos:~$
vyos@vyos:~$
vyos@vyos:~$ vtysh -c "show run bgp"
Building configuration...

Current configuration:
!
frr version 7.5-20210212-00-gbc460d132
frr defaults traditional
hostname vyos
service integrated-vtysh-config
!
router bgp 1
 no bgp ebgp-requires-policy      <--- Default behavior disabling RFC8212 operation
 no bgp network import-check
!
line vty
!
end

Enabling RFC8212 operation:

vyos@vyos# set protocols bgp 1 parameters ebgp-requires-policy
[edit]
vyos@vyos# compare
[edit protocols bgp 1]
+parameters {
+    ebgp-requires-policy
+}
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# exit
Warning: configuration changes have not been saved.
exit

vyos@vyos:~$ vtysh -c "show run bgp"
Building configuration...

Current configuration:
!
frr version 7.5-20210212-00-gbc460d132
frr defaults traditional
hostname vyos
service integrated-vtysh-config
!
router bgp 1
 no bgp network import-check
!                                                  <---- It is no longer here, therefore it is enabled
line vty
!
end

Deleting, and restoring default disabled RFC8212 operation:

vyos@vyos# delete protocols bgp 1 parameters
[edit]
vyos@vyos# compare
[edit protocols bgp 1]
-parameters {
-    ebgp-requires-policy
-}
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# exit
Warning: configuration changes have not been saved.
exit

vyos@vyos:~$ vtysh -c "show run bgp"
Building configuration...

Current configuration:
!
frr version 7.5-20210212-00-gbc460d132
frr defaults traditional
hostname vyos
service integrated-vtysh-config
!
router bgp 1
 no bgp ebgp-requires-policy      <--- Default behavior of disabling RFC8212 operation returned
 no bgp network import-check
!
line vty
!
end

Checklist:

data/templates/frr/bgp.frr.tmpl Outdated Show resolved Hide resolved
@Cheeze-It Cheeze-It changed the title BGP: T2100: Changing RFC8212 behavior and option toggle bgp: T2100: Changing RFC8212 behavior and option toggle Feb 26, 2021
@Cheeze-It
Copy link
Contributor Author

Cheeze-It commented Feb 26, 2021

Did the checks on the jinja2 template, and found out we can't call the following:
{% if parameters.ebgp_requires_policy is not defined %}no{% endif %} bgp ebgp-requires-policy

The reason why is because it fails as the "parameters" stanza is not called. It needs be outside of that entire stanza for it to work. I figure we can just leave the "no bgp ebgp-requires-policy" on line 181. Unless you'd like to move it to somewhere else. But we can't move it under "parameters."

In this commit we add the default operation within BGP
to have RFC8212 disabled for eBGP routes. This default
should preserve the normal behavior for VyOS from earlier
releases of FRR to the current latest release. Another
option that we add is the ability to toggle whether or
not RFC8212 is enabled or disabled.
@Cheeze-It
Copy link
Contributor Author

Here we go, this now works as we expect.

@c-po c-po merged commit 6342735 into vyos:current Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants