Skip to content

Conversation

c-po
Copy link
Member

@c-po c-po commented Aug 28, 2025

Change summary

Originating from the bug in T7665. To avoid potential issues down the line - and given that there's no compelling technical reason to retain the system-as CLI node under per-VRF BGP configuration, which cannot be achieved through alternative means - the maintainers have collectively decided to deprecate the following command:

set vrf name <name> protocols bgp system-as <asn>

Starting with VyOS 1.4.4, this CLI command will be considered deprecated. While it will still be accepted, it will no longer have any operational effect. A deprecation warning will be displayed at commit time, indicating that the BGP ASN from the global BGP configuration is now used instead.

A migration script will handle the transition and perform the following actions:

  • Ensure a global BGP configuration exists; if not, initialize one.
  • Iterate over all configured VRFs to determine whether a BGP instance exists
  • For any insance, update the configuration to use the global system-as
    and apply the local-as ASN no-prepend replace-as option on all affected
    neighbors to preserve existing behavior.
  • If a neighbor is already configured with a local-as directive, that neighbor
    will be excluded from the migration process, as it already follows a custom
    configuration.

The following migration takes place - verified by smoketests

$ /usr/libexec/vyos/run-config-migration.py --test-script /opt/vyatta/etc/config-migrate/migrate/bgp/6-to-7 --output-file /tmp/foo /usr/libexec/vyos/tests/config/bgp-evpn-l3vpn-vrf-different-asn
$ diff -Nurd /usr/libexec/vyos/tests/config/bgp-evpn-l3vpn-vrf-different-asn /tmp/foo
--- /usr/libexec/vyos/tests/config/bgp-evpn-l3vpn-vrf-different-asn     2023-09-10 15:42:53.000000000 +0200
+++ /tmp/foo    2025-08-28 15:49:47.819719018 +0200
@@ -210,6 +210,11 @@
                             maximum-prefix "20"
                         }
                     }
+                    local-as 667 {
+                        no-prepend {
+                            replace-as
+                        }
+                    }
                     remote-as "100"
                 }
                 neighbor 192.0.2.4 {
@@ -227,9 +232,13 @@
                         ipv4-unicast {
                         }
                     }
+                    local-as 667 {
+                        no-prepend {
+                            replace-as
+                        }
+                    }
                     remote-as "112"
                 }
-                system-as "667"
             }
         }
         table "2001"
@@ -252,6 +261,11 @@
                     peer-group "foo"
                 }
                 neighbor 192.0.2.12 {
+                    local-as 65412 {
+                        no-prepend {
+                            replace-as
+                        }
+                    }
                     peer-group "bar"
                 }
                 neighbor 192.0.2.14 {
@@ -281,7 +295,6 @@
                     }
                     remote-as "300"
                 }
-                system-as "65412"
             }
         }
         table "3001"

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): CLI command deprecation

Related Task(s)

Related PR(s)

How to test / Smoketest result

[email protected]:~$ /usr/libexec/vyos/tests/smoke/cli/test_protocols_bgp.py
test_bgp_01_simple (__main__.TestProtocolsBGP.test_bgp_01_simple) ... ok
test_bgp_02_neighbors (__main__.TestProtocolsBGP.test_bgp_02_neighbors) ... ok
test_bgp_03_peer_groups (__main__.TestProtocolsBGP.test_bgp_03_peer_groups) ... ok
test_bgp_04_afi_ipv4 (__main__.TestProtocolsBGP.test_bgp_04_afi_ipv4) ... ok
test_bgp_05_afi_ipv6 (__main__.TestProtocolsBGP.test_bgp_05_afi_ipv6) ... ok
test_bgp_06_listen_range (__main__.TestProtocolsBGP.test_bgp_06_listen_range) ... ok
test_bgp_07_l2vpn_evpn (__main__.TestProtocolsBGP.test_bgp_07_l2vpn_evpn) ... ok
test_bgp_09_distance_and_flowspec (__main__.TestProtocolsBGP.test_bgp_09_distance_and_flowspec) ... ok
test_bgp_10_vrf_simple (__main__.TestProtocolsBGP.test_bgp_10_vrf_simple) ... ok
test_bgp_11_confederation (__main__.TestProtocolsBGP.test_bgp_11_confederation) ... ok
test_bgp_12_v6_link_local (__main__.TestProtocolsBGP.test_bgp_12_v6_link_local) ... ok
test_bgp_13_vpn (__main__.TestProtocolsBGP.test_bgp_13_vpn) ... ok
test_bgp_14_remote_as_peer_group_override (__main__.TestProtocolsBGP.test_bgp_14_remote_as_peer_group_override) ... ok
test_bgp_15_import_rd_rt_compatibility (__main__.TestProtocolsBGP.test_bgp_15_import_rd_rt_compatibility) ... ok
test_bgp_16_import_rd_rt_compatibility (__main__.TestProtocolsBGP.test_bgp_16_import_rd_rt_compatibility) ... ok
test_bgp_17_deleting_import_vrf (__main__.TestProtocolsBGP.test_bgp_17_deleting_import_vrf) ... ok
test_bgp_18_deleting_default_vrf (__main__.TestProtocolsBGP.test_bgp_18_deleting_default_vrf) ... ok
test_bgp_19_import_rd_rt_compatibility (__main__.TestProtocolsBGP.test_bgp_19_import_rd_rt_compatibility) ... ok
test_bgp_20_import_unspecified_vrf (__main__.TestProtocolsBGP.test_bgp_20_import_unspecified_vrf) ... ok
test_bgp_21_interface_mpls_forwarding (__main__.TestProtocolsBGP.test_bgp_21_interface_mpls_forwarding) ... ok
test_bgp_22_vrf_interface_mpls_forwarding (__main__.TestProtocolsBGP.test_bgp_22_vrf_interface_mpls_forwarding) ... ok
test_bgp_23_srv6_sid (__main__.TestProtocolsBGP.test_bgp_23_srv6_sid) ... ok
test_bgp_24_ipv4_labeled_unicast_peer_group (__main__.TestProtocolsBGP.test_bgp_24_ipv4_labeled_unicast_peer_group) ... ok
test_bgp_25_ipv6_labeled_unicast_peer_group (__main__.TestProtocolsBGP.test_bgp_25_ipv6_labeled_unicast_peer_group) ... ok
test_bgp_26_route_reflector_client (__main__.TestProtocolsBGP.test_bgp_26_route_reflector_client) ... ok
test_bgp_27_peer_group_member_all_internal_or_external (__main__.TestProtocolsBGP.test_bgp_27_peer_group_member_all_internal_or_external) ... ok
test_bgp_29_peer_group_remote_as_equal_local_as (__main__.TestProtocolsBGP.test_bgp_29_peer_group_remote_as_equal_local_as) ... ok
test_bgp_30_import_vrf_routemap (__main__.TestProtocolsBGP.test_bgp_30_import_vrf_routemap) ... ok
test_bgp_99_bmp (__main__.TestProtocolsBGP.test_bgp_99_bmp) ... ok

----------------------------------------------------------------------
Ran 29 tests in 347.712s

OK

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@c-po c-po self-assigned this Aug 28, 2025
@c-po c-po added bp/sagitta Create automatic backport for sagitta LTS version bp/circinus Create automatic backport for circinus labels Aug 28, 2025
Copy link

github-actions bot commented Aug 28, 2025

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Aug 28, 2025

✅ No issues found in unused-imports check.. Please refer the workflow run

@c-po c-po requested review from dmbaturin, sever-sever and zdc August 28, 2025 13:08
@c-po c-po force-pushed the bgp-vrf-system-as branch 3 times, most recently from 0e800f1 to 20a4de7 Compare August 28, 2025 13:57
@vyos vyos deleted a comment from github-actions bot Aug 28, 2025
@vyos vyos deleted a comment from github-actions bot Aug 28, 2025
@c-po c-po removed the conflicts label Aug 28, 2025
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

c-po added 2 commits August 28, 2025 17:40
Originating from the bug in T7665. To avoid potential issues down the line - and
given that there's no compelling technical reason to retain the system-as CLI
node under per-VRF BGP configuration, which cannot be achieved through
alternative means - the maintainers have collectively decided to deprecate the
following command:

set vrf name <name> protocols bgp system-as <asn>

Starting with VyOS 1.4.4, this CLI command will be considered deprecated. While
it will still be accepted, it will no longer have any operational effect. A
deprecation warning will be displayed at commit time, indicating that the BGP
ASN from the global BGP configuration is now used instead.

A migration script will handle the transition and perform the following actions:
* Ensure a global BGP configuration exists; if not, initialize one.
* Iterate over all configured VRFs to determine whether a BGP instance exists
* For any insance, update the configuration to use the global system-as
  and apply the local-as ASN no-prepend replace-as option on all affected
  neighbors to preserve existing behavior.
* If a neighbor is already configured with a local-as directive, that neighbor
  will be excluded from the migration process, as it already follows a custom
  configuration.
VyOS 1.5 and onwards will no longer have the following CLI node available:
  set vrf name <name> protocols bgp system-as <asn>
@c-po c-po force-pushed the bgp-vrf-system-as branch from 20a4de7 to 2781519 Compare August 28, 2025 15:40
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests VPP 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • Config tests VPP 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bp/circinus Create automatic backport for circinus bp/sagitta Create automatic backport for sagitta LTS version current
Development

Successfully merging this pull request may close these issues.

1 participant