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

There should be a validation of inputs for "configure interface ip" command #6358

Open
Hedgehog-Guru opened this issue Jan 5, 2021 · 0 comments · May be fixed by sonic-net/sonic-utilities#1381

Comments

@Hedgehog-Guru
Copy link

Description
CLI command configure interface ip doesn't check correctness of inputs.

Steps to reproduce the issue
It's possible to write to DB wrong settings for nonexistent and erroneous vlans

    config interface ip add Vlan4095 10.0.0.1/24
    config interface ip add Vlan0 10.0.0.1/24
    config interface ip add Vlan1 10.0.0.1/24

Command doesn't check correctness of vlan number in case of creation sub-interfaces

    config interface ip add Ethernet44.5000 10.0.0.1/24
    config interface ip add Ethernet44.* 10.0.0.1/24
    config interface ip add Ethernet44.0 10.0.0.1/24
    config interface ip add Ethernet44.A 10.0.0.1/24
    config interface ip add Ethernet44.01 10.0.0.1/24

Describe the results you received

There is no validation in case of specifying misguided vlan number for sub-interface or interface vlan.

Wrong settings for nonexistent and erroneous vlans were written to DB:

show runningconfiguration all | grep -A 10 "VLAN_INTERFACE"
    "VLAN_INTERFACE": {
        "Vlan0": {}, 
        "Vlan1": {}, 
        "Vlan4095": {}, 
        "Vlan0|10.0.0.1/24": {}, 
        "Vlan1|10.0.0.1/24": {}, 
        "Vlan4095|10.0.0.1/24": {}
    }

Describe the results you expected
This CLI command should check inputs and prevent user form configuring wrong vlan number for sub-interface or interface vlan.

Output of show version

SONiC Software Version: SONiC.201911.51-dea38d15
Distribution: Debian 9.13
Kernel: 4.9.0-11-2-amd64
Build commit: dea38d15
Build date: Mon Jan  4 13:38:57 UTC 2021
Built by: sw-r2d2-bot@r-build-sonic-ci02

Platform: x86_64-mlnx_msn3700c-r0
HwSKU: ACS-MSN3700C
ASIC: mellanox
Serial Number: MT1935X01905
Uptime: 14:13:55 up 58 min,  1 user,  load average: 2.48, 1.69, 1.49

Docker images:
REPOSITORY                    TAG                  IMAGE ID            SIZE
docker-syncd-mlnx             201911.51-dea38d15   aaaa6191ae77        399MB
docker-syncd-mlnx             latest               aaaa6191ae77        399MB
docker-sonic-telemetry        201911.51-dea38d15   677d64c827c7        353MB
docker-sonic-telemetry        latest               677d64c827c7        353MB
docker-router-advertiser      201911.51-dea38d15   569ab41a4654        290MB
docker-router-advertiser      latest               569ab41a4654        290MB
docker-platform-monitor       201911.51-dea38d15   a5bc7ebc9b2c        666MB
docker-platform-monitor       latest               a5bc7ebc9b2c        666MB
docker-fpm-frr                201911.51-dea38d15   1ad8a005128e        335MB
docker-fpm-frr                latest               1ad8a005128e        335MB
docker-teamd                  201911.51-dea38d15   3779578c25cd        315MB
docker-teamd                  latest               3779578c25cd        315MB
docker-lldp-sv2               201911.51-dea38d15   52a8ee60c1c5        312MB
docker-lldp-sv2               latest               52a8ee60c1c5        312MB
docker-dhcp-relay             201911.51-dea38d15   b752e2e86795        300MB
docker-dhcp-relay             latest               b752e2e86795        300MB
docker-database               201911.51-dea38d15   873fd83afd69        290MB
docker-database               latest               873fd83afd69        290MB
docker-snmp-sv2               201911.51-dea38d15   5379eb90ea3e        348MB
docker-snmp-sv2               latest               5379eb90ea3e        348MB
docker-orchagent              201911.51-dea38d15   1437f5b610dd        333MB
docker-orchagent              latest               1437f5b610dd        333MB
docker-sflow                  201911.51-dea38d15   8abc08609485        315MB
docker-sflow                  latest               8abc08609485        315MB
docker-nat                    201911.51-dea38d15   f0ac3672d083        316MB
docker-nat                    latest               f0ac3672d083        316MB
docker-sonic-mgmt-framework   201911.51-dea38d15   be78292b43d4        429MB
docker-sonic-mgmt-framework   latest               be78292b43d4        429MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant