sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
741 stars 1.43k forks source link

Yang model does not allow the use of subinterfaces for bgp neighbors #18965

Open joolli opened 6 months ago

joolli commented 6 months ago

Description

Yang model for bgp-neighbor does not allow the use of subinterfaces for bgp neighbors. FRR allows this and the setup works as expected.

Steps to reproduce the issue:

  1. Create a subinterface ==> config subinterface add Ethernet0.5
  2. Create a bgp-unnumbered neighbor using subinterface ==> config bgp-neighbor bgp-neighbor-list add --peer-type external default Ethernet0.5

Describe the results you received:

# config bgp-neighbor bgp-neighbor-list add --peer-type external default Ethernet0.5
libyang[0]: Invalid value "Ethernet0.5" in "neighbor" element. (path: /sonic-bgp-neighbor:sonic-bgp-neighbor/BGP_NEIGHBOR/BGP_NEIGHBOR_LIST[vrf_name='default'][neighbor='Ethernet0.5']/neighbor)
sonic_yang(3):Data Loading Failed:Invalid value "Ethernet0.5" in "neighbor" element.
Error: Failed to validate configuration: Data Loading Failed
Invalid value "Ethernet0.5" in "neighbor" element.
Aborted!

Describe the results you expected:

I exptected the command to succeed and frrcfgd to create a bgp-unnumbered neighbor, using the subinterface, in FRR, looking like this: neighbor Ethernet0.5 interface remote-as external

Output of show version:

SONiC Software Version: SONiC.202311.537842-1d8111206
SONiC OS Version: 11
Distribution: Debian 11.9
Kernel: 5.10.0-23-2-amd64
Build commit: 1d8111206
Build date: Fri May  3 11:35:30 UTC 2024
Built by: AzDevOps@vmss-soni003LFY

Platform: x86_64-mlnx_msn2700-r0
HwSKU: ACS-MSN2700
ASIC: mellanox
ASIC Count: 1
Serial Number: MT1910X00109
Model Number: MSN2700-CS2F
Hardware Revision: A2
Uptime: 11:50:30 up 23:57,  1 user,  load average: 1.71, 1.57, 1.55
Date: Tue 14 May 2024 11:50:30 AM

Docker images:
REPOSITORY                    TAG                       IMAGE ID       SIZE
docker-syncd-mlnx             202311.537842-1d8111206   cc5565facb53   874MB
docker-syncd-mlnx             latest                    cc5565facb53   874MB
docker-platform-monitor       202311.537842-1d8111206   f55d79e0a02d   863MB
docker-platform-monitor       latest                    f55d79e0a02d   863MB
docker-macsec                 latest                    9a143f974dc2   329MB
docker-dhcp-relay             latest                    49d85ed36e49   310MB
docker-eventd                 202311.537842-1d8111206   b43d730fcacb   301MB
docker-eventd                 latest                    b43d730fcacb   301MB
docker-orchagent              202311.537842-1d8111206   def7315f0340   339MB
docker-orchagent              latest                    def7315f0340   339MB
docker-fpm-frr                202311.537842-1d8111206   6ba17e6ea215   359MB
docker-fpm-frr                latest                    6ba17e6ea215   359MB
docker-nat                    202311.537842-1d8111206   1f9a3713fceb   330MB
docker-nat                    latest                    1f9a3713fceb   330MB
docker-sflow                  202311.537842-1d8111206   fb34b34a97fb   328MB
docker-sflow                  latest                    fb34b34a97fb   328MB
docker-teamd                  202311.537842-1d8111206   4b0a59de72fa   327MB
docker-teamd                  latest                    4b0a59de72fa   327MB
docker-snmp                   202311.537842-1d8111206   7610c5f8c5af   340MB
docker-snmp                   latest                    7610c5f8c5af   340MB
docker-router-advertiser      202311.537842-1d8111206   ad72fd6744b0   301MB
docker-router-advertiser      latest                    ad72fd6744b0   301MB
docker-lldp                   202311.537842-1d8111206   67eb7e462c9a   343MB
docker-lldp                   latest                    67eb7e462c9a   343MB
docker-mux                    202311.537842-1d8111206   95e4fe2004f4   349MB
docker-mux                    latest                    95e4fe2004f4   349MB
docker-sonic-gnmi             202311.537842-1d8111206   8c3e356e7c6f   389MB
docker-sonic-gnmi             latest                    8c3e356e7c6f   389MB
docker-database               202311.537842-1d8111206   bdeff783568c   301MB
docker-database               latest                    bdeff783568c   301MB
docker-sonic-mgmt-framework   202311.537842-1d8111206   b852505a02a6   416MB
docker-sonic-mgmt-framework   latest                    b852505a02a6   416MB
joolli commented 3 months ago

Made a change which works. Don't know how offer the fix. https://github.com/sonic-net/sonic-buildimage/commit/092fc2e994f8a80abdabd30f2a5c7f4a2f50e100