Skip to content

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

@dgsudharsan

Description

@dgsudharsan

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions