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

[yang] sonic-bgp-peerrange.yang same ip_range is not allowed - sonic yang extension #10376

Open
wen587 opened this issue Mar 29, 2022 · 5 comments
Labels
Help Wanted 🆘 Triaged this issue has been triaged YANG YANG model related changes

Comments

@wen587
Copy link
Contributor

wen587 commented Mar 29, 2022

Description

ip_range in sonic-bgp-peerrange.yang is not allowed.

Steps to reproduce the issue:

  1. Initial peer_range setup in kvm t0
    "BGP_PEER_RANGE": {
        "BGPSLBPassive": {
            "ip_range": [
                "10.255.0.0/25"
            ],
            "name": "BGPSLBPassive",
            "src_address": "10.1.0.32"
        },
        "BGPVac": {
            "ip_range": [
                "192.168.0.0/21"
            ],
            "name": "BGPVac",
            "src_address": "10.1.0.32"
        }
    }
  1. Add two extra config. One with same ip_range with BGPVac, the other is not.
admin@vlab-01:~$ cat peer_range.json
{
   "BGP_PEER_RANGE": {
       "test1": {
           "ip_range": [
               "192.168.0.0/21"
           ],
           "name": "test1",
           "src_address": "10.1.0.32"
       },
       "test2": {
           "ip_range": [
               "192.169.0.0/21"
           ],
           "name": "test2",
           "src_address": "10.1.0.32"
       }

   }
}
admin@vlab-01:~$ sudo config load -y peer_range.json
Running command: /usr/local/bin/sonic-cfggen -j peer_range.json --write-to-db
  1. Check bgp config. Only one is added.
admin@vlab-01:~$ show run bgp | grep "listen range"
 bgp listen range 10.255.0.0/25 peer-group BGPSLBPassive
 bgp listen range 192.168.0.0/21 peer-group BGPVac
 bgp listen range 192.169.0.0/21 peer-group test2

Describe the results you received:

See above.

Describe the results you expected:

In GCU test, syslog will report error:

Mar 28 07:45:54.686979 vlab-01 ERR bgp#bgpcfgd: command execution returned 13. Command: '['vtysh', '-f', '/tmp/tmp5d_n7k5w']', stdout: '% Same listen range is attached to peer-group BGPSLBPassive#012', stderr: 'line 37: Failure to communicate[13] to bgpd, line:   bgp listen range 192.168.0.0/21 peer-group BGPVac#012#012'
Mar 28 07:45:54.686979 vlab-01 ERR bgp#bgpcfgd: ConfigMgr::commit(): can't push configuration from file='/tmp/tmp5d_n7k5w', rc='13', stdout='% Same listen range is attached to peer-group BGPSLBPassive#012', stderr='line 37: Failure to communicate[13] to bgpd, line:   bgp listen range 192.168.0.0/21 peer-group BGPVac#012#012'

Yang should restrict ip_range to make it exclusive.

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

@zhangyanzhao
Copy link
Collaborator

Qi will double check with Jingwen if the issue still exists.

@wen587
Copy link
Contributor Author

wen587 commented Sep 23, 2022

It is not an issue for GCU now as we have a fix ourselves. sonic-net/sonic-utilities#2145
We keep this issue open to see if we can have yang extension support.

@qiluo-msft
Copy link
Collaborator

@praveen-li This is to track sonic yang extension issue, which is similar to unique lane yang extension. Currently the validator is hardcoded as python function validate_bgp_peer_group.

@zhangyanzhao
Copy link
Collaborator

#9692 is required to support this.

@zhangyanzhao zhangyanzhao changed the title [yang] sonic-bgp-peerrange.yang same ip_range is not allowed [yang] sonic-bgp-peerrange.yang same ip_range is not allowed - sonic yang extension Mar 9, 2023
@zhangyanzhao
Copy link
Collaborator

pump up to get help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted 🆘 Triaged this issue has been triaged YANG YANG model related changes
Projects
None yet
Development

No branches or pull requests

4 participants