summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-02-14 17:25:37 +0100
committerChristian Breunig <christian@breunig.cc>2026-02-14 17:28:13 +0100
commitab888b9d959a894e280fa83d01a935f16bdd10f1 (patch)
tree1a07819dc016edb0c2eaddc8e1f2558958171310
parentd6fdf9db8497164921afb28abc22f1c7bcd18f52 (diff)
downloadvyos-1x-ab888b9d959a894e280fa83d01a935f16bdd10f1.tar.gz
vyos-1x-ab888b9d959a894e280fa83d01a935f16bdd10f1.zip
bgp: T7984: add CLI support for "neighbor <N> remote-as auto"
FRR implemented a new know to learn the peers remote ASN from the BGP OPEN message from https://github.com/FRRouting/frr/pull/16345.
-rw-r--r--interface-definitions/include/bgp/remote-as.xml.i8
-rwxr-xr-xsmoketest/scripts/cli/test_protocols_bgp.py8
2 files changed, 10 insertions, 6 deletions
diff --git a/interface-definitions/include/bgp/remote-as.xml.i b/interface-definitions/include/bgp/remote-as.xml.i
index 79d3b95a9..4c622b831 100644
--- a/interface-definitions/include/bgp/remote-as.xml.i
+++ b/interface-definitions/include/bgp/remote-as.xml.i
@@ -3,13 +3,17 @@
<properties>
<help>Neighbor BGP AS number</help>
<completionHelp>
- <list>external internal</list>
+ <list>auto external internal</list>
</completionHelp>
<valueHelp>
<format>u32:1-4294967294</format>
<description>Neighbor AS number</description>
</valueHelp>
<valueHelp>
+ <format>auto</format>
+ <description>Automatically detect remote AS</description>
+ </valueHelp>
+ <valueHelp>
<format>external</format>
<description>Any AS different from the local AS</description>
</valueHelp>
@@ -19,7 +23,7 @@
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-4294967294"/>
- <regex>(external|internal)</regex>
+ <regex>(auto|external|internal)</regex>
</constraint>
<constraintErrorMessage>Invalid AS number</constraintErrorMessage>
</properties>
diff --git a/smoketest/scripts/cli/test_protocols_bgp.py b/smoketest/scripts/cli/test_protocols_bgp.py
index 06377eee3..edd797cf6 100755
--- a/smoketest/scripts/cli/test_protocols_bgp.py
+++ b/smoketest/scripts/cli/test_protocols_bgp.py
@@ -40,7 +40,7 @@ bfd_profile = 'foo-bar-baz'
import_afi = 'ipv4-unicast'
import_vrf = 'red'
-import_rd = ASN + ':100'
+import_rd = f'{ASN}:100'
import_vrf_base = ['vrf', 'name']
neighbor_config = {
'192.0.2.1' : {
@@ -64,7 +64,7 @@ neighbor_config = {
},
'192.0.2.2' : {
'bfd_profile' : bfd_profile,
- 'remote_as' : '200',
+ 'remote_as' : 'auto',
'shutdown' : '',
'no_cap_nego' : '',
'port' : '667',
@@ -111,7 +111,7 @@ neighbor_config = {
'local_role_strict': '',
},
'2001:db8::2' : {
- 'remote_as' : '456',
+ 'remote_as' : 'auto',
'shutdown' : '',
'no_cap_nego' : '',
'port' : '667',
@@ -141,7 +141,7 @@ peer_group_config = {
'p_attr_discard' : ['100', '150', '200'],
},
'bar' : {
- 'remote_as' : '111',
+ 'remote_as' : 'auto',
'graceful_rst_no' : '',
'port' : '667',
'p_attr_taw' : '126',