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

[Config]config interface ip command doesn't validate interface name #16975

Open
dgsudharsan opened this issue Oct 23, 2023 · 1 comment
Open

Comments

@dgsudharsan
Copy link
Collaborator

Description

There is no interface name validation when adding IP address. Below are some examples

root@sonic:~# config interface ip add Vlan000000000000003 1.1.1.1/24
root@sonic:~# config interface ip add Vlan000000000000004 1.1.1.1/24
root@sonic:~#
root@sonic:~#
root@sonic:~# config interface ip add Vlan3 3.1.1.1/24
root@sonic:~#
root@sonic:~# show vlan brief
+-----------+--------------+-----------+----------------+-------------+-----------------------+
|   VLAN ID | IP Address   | Ports     | Port Tagging   | Proxy ARP   | DHCP Helper Address   |
+===========+==============+===========+================+=============+=======================+
|         2 |              | Ethernet0 | tagged         | disabled    |                       |
+-----------+--------------+-----------+----------------+-------------+-----------------------+
root@sonic:~#

root@sonic:~# config interface ip add PortChannelabc 1.1.2.3/24
root@sonic:~#
root@sonic:~# config interface ip add Vlan10.1000 4.5.1.3/24
root@sonic:~# show subinterfaces status
  Sub port interface    Speed    MTU    Vlan    Admin    Type
--------------------  -------  -----  ------  -------  ------
root@sonic:~# show interfaces  portchannel
Flags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available,
       S - selected, D - deselected, * - not synced
No.    Team Dev    Protocol    Ports
-----  ----------  ----------  -------
root@sonic:~#

Steps to reproduce the issue:

  1. config interface ip add

Describe the results you received:

No error is thrown at CLI
No error log in syslog

Describe the results you expected:

The configuration should be rejected and CLI command should throw error

Output of show version:

Seen in master and all other branches. This is a day 1 issue.

(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):

@matiAlfaro
Copy link
Contributor

@dgsudharsan
sonic-net/sonic-utilities#3155 should fix this

lguohan pushed a commit that referenced this issue Mar 30, 2024
…18207)

Related to #3155
Update sonic-vlan.yang model to match requirement as described in #16975

Signed-off-by: matiAlfaro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants