sonic-net / sonic-utilities

Command line utilities for the SONiC project
Other
152 stars 644 forks source link

In alias naming_mode, the interface alias in some show commands is incorrect. #658

Closed leoli-nps closed 4 years ago

leoli-nps commented 5 years ago

Description

  1. Interface name and alias

    admin@tau1t8-01:~$ show interfaces status
      Interface            Lanes    Speed    MTU         Alias             Vlan    Oper    Admin            Type    Asym PFC
    ---------------  ---------------  -------  -----  ------------  ---------------  ------  -------  --------------  ----------
      Ethernet0                8      10G   9100   Ethernet1/1           routed    down     down  SFP/SFP+/SFP28         off
      Ethernet1                9      10G   9100   Ethernet2/1            trunk      up       up  SFP/SFP+/SFP28         off
      Ethernet2               10      10G   9100   Ethernet3/1            trunk      up       up  SFP/SFP+/SFP28         off
      Ethernet3               11      10G   9100   Ethernet4/1            trunk      up       up  SFP/SFP+/SFP28         off
      Ethernet4               12      10G   9100   Ethernet5/1            trunk      up       up  SFP/SFP+/SFP28         off
      Ethernet5               13      10G   9100   Ethernet6/1            trunk      up       up  SFP/SFP+/SFP28         off
      Ethernet6               14      10G   9100   Ethernet7/1            trunk      up       up  SFP/SFP+/SFP28         off
      Ethernet7               15      10G   9100   Ethernet8/1            trunk      up       up  SFP/SFP+/SFP28         off
      Ethernet8               16      10G   9100   Ethernet9/1            trunk      up       up  SFP/SFP+/SFP28         off
      Ethernet9               17      10G   9100  Ethernet10/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet10               18      10G   9100  Ethernet11/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet11               19      10G   9100  Ethernet12/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet12               20      10G   9100  Ethernet13/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet13               21      10G   9100  Ethernet14/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet14               22      10G   9100  Ethernet15/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet15               23      10G   9100  Ethernet16/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet16               32      10G   9100  Ethernet17/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet17               33      10G   9100  Ethernet18/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet18               34      10G   9100  Ethernet19/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet19               35      10G   9100  Ethernet20/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet20               40      10G   9100  Ethernet21/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet21               41      10G   9100  Ethernet22/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet22               42      10G   9100  Ethernet23/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet23               43      10G   9100  Ethernet24/1            trunk      up       up  SFP/SFP+/SFP28         off
     Ethernet24               48      10G   9100  Ethernet25/1            trunk      up       up             N/A         off
     Ethernet25               49      10G   9100  Ethernet26/1           routed    down     down             N/A         off
     Ethernet26               50      10G   9100  Ethernet27/1           routed    down     down             N/A         off
     Ethernet27               51      10G   9100  Ethernet28/1           routed    down     down             N/A         off
     Ethernet28               56      10G   9100  Ethernet29/1  PortChannel0001      up       up             N/A         off
     Ethernet29               57      10G   9100  Ethernet30/1  PortChannel0002      up       up             N/A         off
     Ethernet30               58      10G   9100  Ethernet31/1  PortChannel0003      up       up             N/A         off
     Ethernet31               59      10G   9100  Ethernet32/1  PortChannel0004      up       up             N/A         off
     Ethernet32               64      10G   9100  Ethernet33/1           routed    down     down             N/A         off
     Ethernet33               65      10G   9100  Ethernet34/1           routed    down     down             N/A         off
     Ethernet34               66      10G   9100  Ethernet35/1           routed    down     down             N/A         off
     Ethernet35               67      10G   9100  Ethernet36/1           routed    down     down             N/A         off
     Ethernet36               68      10G   9100  Ethernet37/1           routed    down     down             N/A         off
     Ethernet37               69      10G   9100  Ethernet38/1           routed    down     down             N/A         off
     Ethernet38               70      10G   9100  Ethernet39/1           routed    down     down             N/A         off
     Ethernet39               71      10G   9100  Ethernet40/1           routed    down     down             N/A         off
     Ethernet40               72      10G   9100  Ethernet41/1           routed    down     down             N/A         off
     Ethernet41               73      10G   9100  Ethernet42/1           routed    down     down             N/A         off
     Ethernet42               74      10G   9100  Ethernet43/1           routed    down     down             N/A         off
     Ethernet43               75      10G   9100  Ethernet44/1           routed    down     down             N/A         off
     Ethernet44               76      10G   9100  Ethernet45/1           routed    down     down             N/A         off
     Ethernet45               77      10G   9100  Ethernet46/1           routed    down     down             N/A         off
     Ethernet46               78      10G   9100  Ethernet47/1           routed    down     down             N/A         off
     Ethernet47               79      10G   9100  Ethernet48/1           routed    down     down             N/A         off
     Ethernet48      80,81,82,83     100G   9100  Ethernet49/1           routed    down     down             N/A         off
     Ethernet49      84,85,86,87     100G   9100  Ethernet50/1           routed    down     down             N/A         off
     Ethernet50  104,105,106,107     100G   9100  Ethernet51/1           routed    down     down             N/A         off
     Ethernet51  108,109,110,111     100G   9100  Ethernet52/1           routed    down     down             N/A         off
     Ethernet52  112,113,114,115     100G   9100  Ethernet53/1           routed    down     down             N/A         off
     Ethernet53  116,117,118,119     100G   9100  Ethernet54/1           routed    down     down             N/A         off
    PortChannel0001              N/A      10G   9100           N/A           routed      up       up             N/A         N/A
    PortChannel0002              N/A      10G   9100           N/A           routed      up       up             N/A         N/A
    PortChannel0003              N/A      10G   9100           N/A           routed      up       up             N/A         N/A
    PortChannel0004              N/A      10G   9100           N/A           routed      up       up             N/A         N/A
    admin@tau1t8-01:~$
  2. Current interface naming_mode is default

    admin@tau1t8-01:~$ show interfaces naming_mode
    default
    admin@tau1t8-01:~$
  3. Execute some show commands

    
    admin@tau1t8-01:~$ 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
    -----  ---------------  -----------  -------------
    0001  PortChannel0001  LACP(A)(Up)  Ethernet28(S)
    0002  PortChannel0002  LACP(A)(Up)  Ethernet29(S)
    0003  PortChannel0003  LACP(A)(Up)  Ethernet30(S)
    0004  PortChannel0004  LACP(A)(Up)  Ethernet31(S)
    admin@tau1t8-01:~$
    admin@tau1t8-01:~$ show queue watermark unicast
    Egress shared pool occupancy per unicast queue:
      Port    UC0    UC1    UC2    UC3    UC4    UC5    UC6    UC7
    ----------  -----  -----  -----  -----  -----  -----  -----  -----
    Ethernet0      0      0      0      0      0      0      0      0
    Ethernet1      0      0      0      0      0      0      0      0
    Ethernet2      0      0      0      0      0      0      0      0
    Ethernet3      0      0      0      0      0      0      0      0
    Ethernet4      0      0      0      0      0      0      0      0
    Ethernet5      0      0      0      0      0      0      0      0
    Ethernet6      0      0      0      0      0      0      0      0
    Ethernet7      0      0      0      0      0      0      0      0
    Ethernet8      0      0      0      0      0      0      0      0
    Ethernet9      0      0      0      0      0      0      0      0
    Ethernet10      0      0      0      0      0      0      0      0
    Ethernet11      0      0      0      0      0      0      0      0
    Ethernet12      0      0      0      0      0      0      0      0
    Ethernet13      0      0      0      0      0      0      0      0
    Ethernet14      0      0      0      0      0      0      0      0
    Ethernet15      0      0      0      0      0      0      0      0
    Ethernet16      0      0      0      0      0      0      0      0
    Ethernet17      0      0      0      0      0      0      0      0
    Ethernet18      0      0      0      0      0      0      0      0
    Ethernet19      0      0      0      0      0      0      0      0
    Ethernet20      0      0      0      0      0      0      0      0
    Ethernet21      0      0      0      0      0      0      0      0
    Ethernet22      0      0      0      0      0      0      0      0
    Ethernet23      0      0      0      0      0      0      0      0
    Ethernet24      0      0      0      0      0      0      0      0
    Ethernet25      0      0      0      0      0      0      0      0
    Ethernet26      0      0      0      0      0      0      0      0
    Ethernet27      0      0      0      0      0      0      0      0
    Ethernet28      0      0      0      0      0      0      0      0
    Ethernet29      0      0      0      0      0      0      0      0
    Ethernet30      0      0      0      0      0      0      0      0
    Ethernet31      0      0      0      0      0      0      0      0
    Ethernet32      0      0      0      0      0      0      0      0
    Ethernet33      0      0      0      0      0      0      0      0
    Ethernet34      0      0      0      0      0      0      0      0
    Ethernet35      0      0      0      0      0      0      0      0
    Ethernet36      0      0      0      0      0      0      0      0
    Ethernet37      0      0      0      0      0      0      0      0
    Ethernet38      0      0      0      0      0      0      0      0
    Ethernet39      0      0      0      0      0      0      0      0
    Ethernet40      0      0      0      0      0      0      0      0
    Ethernet41      0      0      0      0      0      0      0      0
    Ethernet42      0      0      0      0      0      0      0      0
    Ethernet43      0      0      0      0      0      0      0      0
    Ethernet44      0      0      0      0      0      0      0      0
    Ethernet45      0      0      0      0      0      0      0      0
    Ethernet46      0      0      0      0      0      0      0      0
    Ethernet47      0      0      0      0      0      0      0      0
    Ethernet48      0      0      0      0      0      0      0      0
    Ethernet49      0      0      0      0      0      0      0      0
    Ethernet50      0      0      0      0      0      0      0      0
    Ethernet51      0      0      0      0      0      0      0      0
    Ethernet52      0      0      0      0      0      0      0      0
    Ethernet53      0      0      0      0      0      0      0      0
    admin@tau1t8-01:~$
    admin@tau1t8-01:~$ show acl table EVERFLOW
    Name      Type    Binding          Description
    --------  ------  ---------------  -------------
    EVERFLOW  MIRROR  Ethernet0        EVERFLOW
                  Ethernet1
                  Ethernet2
                  Ethernet3
                  Ethernet4
                  Ethernet5
                  Ethernet6
                  Ethernet7
                  Ethernet8
                  Ethernet9
                  Ethernet10
                  Ethernet11
                  Ethernet12
                  Ethernet13
                  Ethernet14
                  Ethernet15
                  Ethernet16
                  Ethernet17
                  Ethernet18
                  Ethernet19
                  Ethernet20
                  Ethernet21
                  Ethernet22
                  Ethernet23
                  Ethernet24
                  Ethernet25
                  Ethernet26
                  Ethernet27
                  Ethernet32
                  Ethernet33
                  Ethernet34
                  Ethernet35
                  Ethernet36
                  Ethernet37
                  Ethernet38
                  Ethernet39
                  Ethernet40
                  Ethernet41
                  Ethernet42
                  Ethernet43
                  Ethernet44
                  Ethernet45
                  Ethernet46
                  Ethernet47
                  Ethernet48
                  Ethernet49
                  Ethernet50
                  Ethernet51
                  Ethernet52
                  Ethernet53
                  PortChannel0001
                  PortChannel0002
                  PortChannel0003
                  PortChannel0004
    admin@tau1t8-01:~$
    admin@tau1t8-01:~$ show ip route 192.168.1.1
    Routing entry for 192.168.1.1/32
    Known via "bgp", distance 20, metric 0, best
    Last update 00:33:58 ago
    * 10.0.0.23, via Ethernet11
    * 10.0.0.1, via Ethernet0
    * 10.0.0.3, via Ethernet1
    * 10.0.0.5, via Ethernet2
    * 10.0.0.7, via Ethernet3
    * 10.0.0.9, via Ethernet4
    * 10.0.0.11, via Ethernet5
    * 10.0.0.13, via Ethernet6
    * 10.0.0.15, via Ethernet7
    * 10.0.0.17, via Ethernet8
    * 10.0.0.19, via Ethernet9
    * 10.0.0.21, via Ethernet10
    * 10.0.0.25, via Ethernet12
    * 10.0.0.27, via Ethernet13
    * 10.0.0.29, via Ethernet14
    * 10.0.0.31, via Ethernet15

admin@tau1t8-01:~$

4. Change the interface naming_mode to alias, then logout and log back

admin@tau1t8-01:~$ sudo config interface_naming_mode alias Please logout and log back in for changes take effect. admin@tau1t8-01:~$ exit logout

Debian GNU/Linux 9 tau1t8-01 ttyS0

tau1t8-01 login: admin Password: Last login: Thu Sep 19 12:22:54 UTC 2019 on ttyS0 Linux tau1t8-01 4.9.0-9-2-amd64 #1 SMP Debian 4.9.168-1+deb9u5 (2015-12-19) x86_64 You are on


/ | / | \ | ()/ | _ | | | | | | | | _) | || | |\ | | | |___/ \/|| _||____|

-- Software for Open Networking in the Cloud --

Unauthorized access and/or use are prohibited. All access and/or use are subject to monitoring.

Help: http://azure.github.io/SONiC/

admin@tau1t8-01:~$

5.  Current interface naming_mode is alias

admin@tau1t8-01:~$ show interfaces naming_mode alias admin@tau1t8-01:~$

6. Execute the show commands again executed in the step 3

admin@tau1t8-01:~$ 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


0001 PortChannel0001 LACP(A)(Up) Ethernet29/1(S) 0002 PortChannel0002 LACP(A)(Up) Ethernet30/1(S) 0003 PortChannel0003 LACP(A)(Up) Ethernet32/1/1(S) 0004 PortChannel0004 LACP(A)(Up) Ethernet32/1(S) admin@tau1t8-01:~$ admin@tau1t8-01:~$ show queue watermark unicast Egress shared pool occupancy per unicast queue: Port UC0 UC1 UC2 UC3 UC4 UC5 UC6 UC7


Ethernet2/1/1 0 0 0 0 0 0 0 0 Ethernet2/1 0 0 0 0 0 0 0 0 Ethernet6/1/1/1/1 0 0 0 0 0 0 0 0 Ethernet6/1/1/1 0 0 0 0 0 0 0 0 Ethernet6/1/1 0 0 0 0 0 0 0 0 Ethernet6/1 0 0 0 0 0 0 0 0 Ethernet8/1/1 0 0 0 0 0 0 0 0 Ethernet8/1 0 0 0 0 0 0 0 0 Ethernet12/1/1/1/1 0 0 0 0 0 0 0 0 Ethernet12/1/1/1 0 0 0 0 0 0 0 0 Ethernet12/1/1 0 0 0 0 0 0 0 0 Ethernet12/1 0 0 0 0 0 0 0 0 Ethernet14/1/1 0 0 0 0 0 0 0 0 Ethernet14/1 0 0 0 0 0 0 0 0 Ethernet17/1/1/1 0 0 0 0 0 0 0 0 Ethernet17/1/1 0 0 0 0 0 0 0 0 Ethernet17/1 0 0 0 0 0 0 0 0 Ethernet18/1 0 0 0 0 0 0 0 0 Ethernet21/1/1/1 0 0 0 0 0 0 0 0 Ethernet21/1/1 0 0 0 0 0 0 0 0 Ethernet21/1 0 0 0 0 0 0 0 0 Ethernet22/1 0 0 0 0 0 0 0 0 Ethernet25/1/1/1 0 0 0 0 0 0 0 0 Ethernet25/1/1 0 0 0 0 0 0 0 0 Ethernet25/1 0 0 0 0 0 0 0 0 Ethernet27/1/1 0 0 0 0 0 0 0 0 Ethernet27/1 0 0 0 0 0 0 0 0 Ethernet28/1 0 0 0 0 0 0 0 0 Ethernet29/1 0 0 0 0 0 0 0 0 Ethernet30/1 0 0 0 0 0 0 0 0 Ethernet32/1/1 0 0 0 0 0 0 0 0 Ethernet32/1 0 0 0 0 0 0 0 0 Ethernet35/1/1/1 0 0 0 0 0 0 0 0 Ethernet35/1/1 0 0 0 0 0 0 0 0 Ethernet35/1 0 0 0 0 0 0 0 0 Ethernet37/1/1 0 0 0 0 0 0 0 0 Ethernet37/1 0 0 0 0 0 0 0 0 Ethernet38/1 0 0 0 0 0 0 0 0 Ethernet40/1/1 0 0 0 0 0 0 0 0 Ethernet40/1 0 0 0 0 0 0 0 0 Ethernet42/1/1 0 0 0 0 0 0 0 0 Ethernet42/1 0 0 0 0 0 0 0 0 Ethernet43/1 0 0 0 0 0 0 0 0 Ethernet44/1 0 0 0 0 0 0 0 0 Ethernet45/1 0 0 0 0 0 0 0 0 Ethernet47/1/1 0 0 0 0 0 0 0 0 Ethernet47/1 0 0 0 0 0 0 0 0 Ethernet48/1 0 0 0 0 0 0 0 0 Ethernet49/1 0 0 0 0 0 0 0 0 Ethernet50/1 0 0 0 0 0 0 0 0 Ethernet54/1/1/1/1 0 0 0 0 0 0 0 0 Ethernet54/1/1/1 0 0 0 0 0 0 0 0 Ethernet54/1/1 0 0 0 0 0 0 0 0 Ethernet54/1 0 0 0 0 0 0 0 0 admin@tau1t8-01:~$ admin@tau1t8-01:~$ show acl table EVERFLOW Name Type Binding Description


EVERFLOW MIRROR Ethernet2/1/1 EVERFLOW Ethernet2/1 Ethernet6/1/1/1/1 Ethernet6/1/1/1 Ethernet6/1/1 Ethernet6/1 Ethernet8/1/1 Ethernet8/1 Ethernet12/1/1/1/1 Ethernet12/1/1/1 Ethernet12/1/1 Ethernet12/1 Ethernet14/1/1 Ethernet14/1 Ethernet17/1/1/1 Ethernet17/1/1 Ethernet17/1 Ethernet18/1 Ethernet21/1/1/1 Ethernet21/1/1 Ethernet21/1 Ethernet22/1 Ethernet25/1/1/1 Ethernet25/1/1 Ethernet25/1 Ethernet27/1/1 Ethernet27/1 Ethernet28/1 Ethernet35/1/1/1 Ethernet35/1/1 Ethernet35/1 Ethernet37/1/1 Ethernet37/1 Ethernet38/1 Ethernet40/1/1 Ethernet40/1 Ethernet42/1/1 Ethernet42/1 Ethernet43/1 Ethernet44/1 Ethernet45/1 Ethernet47/1/1 Ethernet47/1 Ethernet48/1 Ethernet49/1 Ethernet50/1 Ethernet54/1/1/1/1 Ethernet54/1/1/1 Ethernet54/1/1 Ethernet54/1 PortChannel0001 PortChannel0002 PortChannel0003 PortChannel0004 admin@tau1t8-01:~$ admin@tau1t8-01:~$ show ip route 192.168.1.1 Routing entry for 192.168.1.1/32 Known via "bgp", distance 20, metric 0, best Last update 00:11:27 ago

admin@tau1t8-01:~$

As shown above, these interface aliases printed with the show commands are not what we expected;
What we expect is the interface alias shown in the step 1.

**Steps to reproduce the issue**
1. As described in “Description”.
2.
3.

**Describe the results you received**
As described in “Description”.

**Describe the results you expected**
As described in “Description”.

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

**Output of `show version`**

admin@tau1t8-01:~$ show version

SONiC Software Version: SONiC.201904.0-dirty-20190918.185754 Distribution: Debian 9.11 Kernel: 4.9.0-9-2-amd64 Build commit: 37207bcb Build date: Thu Sep 19 02:23:41 UTC 2019 Built by: build@nps65

Platform: x86_64-accton_as7116_54x-r0 HwSKU: Accton-AS7116-54X ASIC: nephos Serial Number: 711654X1737002 Uptime: 12:05:02 up 25 min, 1 user, load average: 0.41, 0.45, 0.39

Docker images: REPOSITORY TAG IMAGE ID SIZE docker-teamd 201904.0-dirty-20190918.185754 475303eba07f 303MB docker-teamd latest 475303eba07f 303MB docker-orchagent 201904.0-dirty-20190918.185754 1f410b366b6d 322MB docker-orchagent latest 1f410b366b6d 322MB docker-fpm-frr 201904.0-dirty-20190918.185754 79d8c094ab99 311MB docker-fpm-frr latest 79d8c094ab99 311MB docker-syncd-nephos-rpc latest 1515ad6beb7f 596MB docker-syncd-nephos latest 1515ad6beb7f 596MB docker-syncd-nephos 201904.0-dirty-20190918.185754 1bbece772cc1 336MB docker-lldp-sv2 201904.0-dirty-20190918.185754 3ec8f0e90e74 299MB docker-lldp-sv2 latest 3ec8f0e90e74 299MB docker-dhcp-relay 201904.0-dirty-20190918.185754 6694d53a6868 288MB docker-dhcp-relay latest 6694d53a6868 288MB docker-database 201904.0-dirty-20190918.185754 e2f43ac980eb 281MB docker-database latest e2f43ac980eb 281MB docker-snmp-sv2 201904.0-dirty-20190918.185754 e321588d7fae 313MB docker-snmp-sv2 latest e321588d7fae 313MB docker-sonic-telemetry 201904.0-dirty-20190918.185754 7bf40cb63c75 303MB docker-sonic-telemetry latest 7bf40cb63c75 303MB docker-router-advertiser 201904.0-dirty-20190918.185754 ef729517bfc2 280MB docker-router-advertiser latest ef729517bfc2 280MB docker-platform-monitor 201904.0-dirty-20190918.185754 10646f5cde63 327MB docker-platform-monitor latest 10646f5cde63 327MB

admin@tau1t8-01:~$



<!--
Also attach debug file produced by `sudo generate_dump`
-->

[sonic_dump_tau1t8-01_20190919_121809.tar.gz](https://github.com/Azure/sonic-utilities/files/3631189/sonic_dump_tau1t8-01_20190919_121809.tar.gz)

Signed-off-by: leo.li leo.li@mediatek.com
jleveque commented 5 years ago

This appears to be due to the fact that you have port aliases which are superstrings of your SONiC port names, but I believe this situation was tested. I will attempt to reproduce and report my findings.

jleveque commented 4 years ago

I was able to reproduce the issue, and I have confirmed that it indeed is due to the fact that you have port aliases which are superstrings of your SONiC port names. I am working on a fix.

jleveque commented 4 years ago

I have created a PR with the fix here: https://github.com/Azure/sonic-utilities/pull/664

Can you please try it out, and report your findings?

leoli-nps commented 4 years ago

@jleveque , I have tested it with your changes and found that the alias is not displayed correctly for the interface name followed by a character. The test results are as follows:

  1. Interface name and alias
    admin@sonic:~$ show interfaces status
      Interface        Lanes    Speed    MTU          Alias             Vlan    Oper    Admin            Type    Asym PFC
    ---------------  -----------  -------  -----  -------------  ---------------  ------  -------  --------------  ----------
      Ethernet0      0,1,2,3     100G   9100    Ethernet1/1           routed    down       up             N/A         N/A
      Ethernet4      4,5,6,7     100G   9100    Ethernet2/1           routed    down       up             N/A         N/A
      Ethernet8    8,9,10,11     100G   9100    Ethernet3/1           routed    down       up             N/A         N/A
     Ethernet12  12,13,14,15     100G   9100    Ethernet4/1           routed    down       up             N/A         N/A
     Ethernet16  16,17,18,19     100G   9100    Ethernet5/1           routed    down       up             N/A         N/A
     Ethernet20  20,21,22,23     100G   9100    Ethernet6/1           routed    down       up             N/A         N/A
     Ethernet24  24,25,26,27     100G   9100    Ethernet7/1           routed    down       up             N/A         N/A
     Ethernet28  28,29,30,31     100G   9100    Ethernet8/1           routed    down       up             N/A         N/A
     Ethernet32  32,33,34,35     100G   9100    Ethernet9/1           routed    down       up             N/A         N/A
     Ethernet36  36,37,38,39     100G   9100   Ethernet10/1           routed    down       up             N/A         N/A
     Ethernet40  40,41,42,43     100G   9100   Ethernet11/1           routed    down       up             N/A         N/A
     Ethernet44  44,45,46,47     100G   9100   Ethernet12/1           routed    down       up             N/A         N/A
     Ethernet48  48,49,50,51     100G   9100   Ethernet13/1           routed    down       up             N/A         N/A
     Ethernet52  52,53,54,55     100G   9100   Ethernet14/1           routed    down       up             N/A         N/A
     Ethernet56  56,57,58,59     100G   9100   Ethernet15/1           routed    down       up             N/A         N/A
     Ethernet60  60,61,62,63     100G   9100   Ethernet16/1           routed    down       up             N/A         N/A
     Ethernet96  96,97,98,99     100G   9100   Ethernet25/1           routed    down       up             N/A         N/A
    Ethernet100          100      10G   9100   Ethernet26/1           routed    down       up             N/A         N/A
    Ethernet101          101      10G   9100   Ethernet26/2           routed    down       up             N/A         N/A
    Ethernet102          102      10G   9100   Ethernet26/3           routed    down       up             N/A         N/A
    Ethernet103          103      10G   9100   Ethernet26/4           routed    down       up             N/A         N/A
    Ethernet104          104      10G   9100   Ethernet27/1           routed    down       up             N/A         N/A
    Ethernet105          105      10G   9100   Ethernet27/2           routed    down       up             N/A         N/A
    Ethernet106          106      10G   9100   Ethernet27/3           routed    down       up             N/A         N/A
    Ethernet107          107      10G   9100   Ethernet27/4           routed    down       up             N/A         N/A
    Ethernet108          108      10G   9100   Ethernet28/1           routed    down       up             N/A         N/A
    Ethernet109          109      10G   9100   Ethernet28/2           routed    down       up             N/A         N/A
    Ethernet110          110      10G   9100   Ethernet28/3           routed    down       up             N/A         N/A
    Ethernet111          111      10G   9100   Ethernet28/4           routed    down       up             N/A         N/A
    Ethernet112          112      10G   9100   Ethernet29/1           routed    down       up             N/A         N/A
    Ethernet113          113      10G   9100   Ethernet29/2           routed    down       up             N/A         N/A
    Ethernet114          114      10G   9100   Ethernet29/3           routed    down       up             N/A         N/A
    Ethernet115          115      10G   9100   Ethernet29/4           routed    down       up             N/A         N/A
    Ethernet116          116      10G   9100   Ethernet30/1           routed    down       up             N/A         N/A
    Ethernet117          117      10G   9100   Ethernet30/2           routed    down       up             N/A         N/A
    Ethernet118          118      10G   9100   Ethernet30/3           routed    down       up             N/A         N/A
    Ethernet119          119      10G   9100   Ethernet30/4           routed    down       up             N/A         N/A
    Ethernet120          120      10G   9100  Ethernet121/1  PortChannel0001      up       up  QSFP+ or later         N/A
    Ethernet121          121      10G   9100  Ethernet122/1           routed      up       up  QSFP+ or later         N/A
    Ethernet122          122      10G   9100  Ethernet123/1           routed      up       up  QSFP+ or later         N/A
    Ethernet123          123      10G   9100  Ethernet124/1  PortChannel0003      up       up  QSFP+ or later         N/A
    Ethernet124          124      10G   9100  Ethernet125/1           routed      up       up  QSFP+ or later         N/A
    Ethernet125          125      10G   9100  Ethernet126/2  PortChannel0004      up       up  QSFP+ or later         N/A
    Ethernet126          126      10G   9100  Ethernet127/3  PortChannel0004      up       up  QSFP+ or later         N/A
    Ethernet127          127      10G   9100  Ethernet128/4  PortChannel0004      up       up  QSFP+ or later         N/A
    PortChannel0001          N/A      10G                   N/A           routed      up       up             N/A         N/A
    PortChannel0003          N/A      10G                   N/A           routed      up       up             N/A         N/A
    PortChannel0004          N/A      30G                   N/A           routed      up       up             N/A         N/A
    admin@sonic:~$
  2. Interface naming_mode is alias
    admin@sonic:~$ show interfaces naming_mode
    alias
    admin@sonic:~$ 
  3. Command line show queue watermark unicast can display correctly
    admin@sonic:~$ show queue watermark unicast
    Egress shared pool occupancy per unicast queue:
       Port    UC0    UC1    UC2    UC3    UC4    UC5    UC6    UC7
    -----------  -----  -----  -----  -----  -----  -----  -----  -----
    Ethernet1/1      0      0      0      0      0      0      0      0
    Ethernet2/1      0      0      0      0      0      0      0      0
    Ethernet3/1      0      0      0      0      0      0      0      0
    Ethernet4/1      0      0      0      0      0      0      0      0
    Ethernet5/1      0      0      0      0      0      0      0      0
    Ethernet6/1      0      0      0      0      0      0      0      0
    Ethernet7/1      0      0      0      0      0      0      0      0
    Ethernet8/1      0      0      0      0      0      0      0      0
    Ethernet9/1      0      0      0      0      0      0      0      0
    Ethernet10/1      0      0      0      0      0      0      0      0
    Ethernet11/1      0      0      0      0      0      0      0      0
    Ethernet12/1      0      0      0      0      0      0      0      0
    Ethernet13/1      0      0      0      0      0      0      0      0
    Ethernet14/1      0      0      0      0      0      0      0      0
    Ethernet15/1      0      0      0      0      0      0      0      0
    Ethernet16/1      0      0      0      0      0      0      0      0
    Ethernet25/1      0      0      0      0      0      0      0      0
    Ethernet26/1      0      0      0      0      0      0      0      0
    Ethernet26/2      0      0      0      0      0      0      0      0
    Ethernet26/3      0      0      0      0      0      0      0      0
    Ethernet26/4      0      0      0      0      0      0      0      0
    Ethernet27/1      0      0      0      0      0      0      0      0
    Ethernet27/2      0      0      0      0      0      0      0      0
    Ethernet27/3      0      0      0      0      0      0      0      0
    Ethernet27/4      0      0      0      0      0      0      0      0
    Ethernet28/1      0      0      0      0      0      0      0      0
    Ethernet28/2      0      0      0      0      0      0      0      0
    Ethernet28/3      0      0      0      0      0      0      0      0
    Ethernet28/4      0      0      0      0      0      0      0      0
    Ethernet29/1      0      0      0      0      0      0      0      0
    Ethernet29/2      0      0      0      0      0      0      0      0
    Ethernet29/3      0      0      0      0      0      0      0      0
    Ethernet29/4      0      0      0      0      0      0      0      0
    Ethernet30/1      0      0      0      0      0      0      0      0
    Ethernet30/2      0      0      0      0      0      0      0      0
    Ethernet30/3      0      0      0      0      0      0      0      0
    Ethernet30/4      0      0      0      0      0      0      0      0
    Ethernet121/1      0      0      0      0      0      0      0      0
    Ethernet122/1      0      0      0      0      0      0      0      0
    Ethernet123/1      0      0      0      0      0      0      0      0
    Ethernet124/1      0      0      0      0      0      0      0      0
    Ethernet125/1      0      0      0      0      0      0      0      0
    Ethernet126/2      0      0      0      0      0      0      0      0
    Ethernet127/3      0      0      0      0      0      0      0      0
    Ethernet128/4      0      0      0      0      0      0      0      0
    admin@sonic:~$ 
  4. Command line show ip route 121.1.1.88 can display correctly
    
    admin@sonic:~$ show ip route 121.1.1.88
    Routing entry for 121.1.1.0/24
    Known via "connected", distance 0, metric 0, best
    Last update 00:36:41 ago
    * directly connected, Ethernet122/1

admin@sonic:~$

5. Command line ``show ip route`` does not display correctly

admin@sonic:~$ show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric,

  • selected route, * - FIB route

K> 0.0.0.0/0 [0/0] via 192.168.2.254, eth0, 00:35:13 C> 1.1.1.0/24 is directly connected, PortChannel0001, 00:34:55 C> 3.1.1.0/24 is directly connected, PortChannel0003, 00:34:55 C> 10.1.0.1/32 is directly connected, lo, 00:35:12 C> 121.1.1.0/24 is directly connected, Ethernet121, 00:34:54 C> 122.1.1.0/24 is directly connected, Ethernet122, 00:34:54 C>* 192.168.2.0/24 is directly connected, eth0, 00:35:13 admin@sonic:~$

6. Command line ``show interfaces portchannel`` does not display correctly

admin@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


0001 PortChannel0001 LACP(A)(Up) Ethernet120(S) 0002 PortChannel0002 LACP(A)(Dw) N/A 0003 PortChannel0003 LACP(A)(Up) Ethernet123(S) 0004 PortChannel0004 LACP(A)(Up) Ethernet127(D) Ethernet126(S*) Ethernet125(S) admin@sonic:~$

jleveque commented 4 years ago

@leoli-nps: Thanks for your detailed feedback. I have pushed another change to https://github.com/Azure/sonic-utilities/pull/664. Can you please try out the new change?

leoli-nps commented 4 years ago

@jleveque , I have tested it according to your new changes. The command line show ip route and show interface portchannel can also display correctly. The test results are as follows:

admin@sonic:~$ show interfaces naming_mode
alias
admin@sonic:~$
admin@sonic:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route

K>* 0.0.0.0/0 [0/0] via 192.168.2.254, eth0, 23:38:23
C>* 1.1.1.0/24 is directly connected, PortChannel0001, 23:38:05
C>* 3.1.1.0/24 is directly connected, PortChannel0003, 23:38:05
C>* 10.1.0.1/32 is directly connected, lo, 23:38:22
C>* 121.1.1.0/24 is directly connected, Ethernet122/1, 23:38:04
C>* 122.1.1.0/24 is directly connected, Ethernet123/1, 23:38:04
C>* 192.168.2.0/24 is directly connected, eth0, 23:38:23
admin@sonic:~$
admin@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
-----  ---------------  -----------  ---------------------------------------------
 0001  PortChannel0001  LACP(A)(Up)  Ethernet121/1(S)
 0002  PortChannel0002  LACP(A)(Dw)  N/A
 0003  PortChannel0003  LACP(A)(Up)  Ethernet124/1(S)
 0004  PortChannel0004  LACP(A)(Up)  Ethernet128/4(D) Ethernet127/3(S*) Ethernet126/2(S)
admin@sonic:~$