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

SONIC_CLI_IFACE_MODE=alias show ip route returns output in json format #8498

Open
sanmalho-git opened this issue Aug 17, 2021 · 0 comments
Open
Labels
Help Wanted 🆘 regression Triaged this issue has been triaged

Comments

@sanmalho-git
Copy link

Description

If we set interface naming mode to 'alias', and run the 'show ip route' command, the output is shown in json format. If we don't set SONIC_CLI_IFACE_MODE or set it to 'default', then the output is not in JSON format

Because of this, sonic-mgmt test test_show_ip_route_v4(https://github.com/Azure/sonic-mgmt/blob/master/tests/iface_namingmode/test_iface_namingmode.py#L921) and test_show_ip_route_v6 are failing when run in alias mode.

Steps to reproduce the issue:

  1. Run the command ''SONIC_IFACE_CLI_MODE=alias show ip route 192.168.1.1'

Describe the results you received:

The output of 'SONIC_IFACE_CLI_MODE=alias show ip route 192.168.1.1 is:

admin@vlab-08:~$ SONIC_CLI_IFACE_MODE=alias show ip route 192.168.1.0
{
  "0.0.0.0\/0":[
    {
      "prefix":"0.0.0.0\/0",
      "protocol":"static",
      "vrfId":0,
      "vrfName":"default",
      "distance":200,
      "metric":0,
      "table":254,
      "internalStatus":0,
      "internalFlags":65,
      "internalNextHopNum":1,
      "internalNextHopActiveNum":0,
      "uptime":"20:39:09",
      "nexthops":[
        {
          "flags":0,
          "ip":"10.250.0.1",
          "afi":"ipv4",
          "weight":1
        }
      ]
    },
    {
      "prefix":"0.0.0.0\/0",
      "protocol":"bgp",
      "vrfId":0,
      "vrfName":"default",
      "selected":true,
      "destSelected":true,
      "distance":20,
      "metric":0,
      "installed":true,
      "table":254,
      "internalStatus":16,
      "internalFlags":8,
      "internalNextHopNum":2,
      "internalNextHopActiveNum":2,
      "uptime":"20:39:09",
      "nexthops":[
        {
          "flags":3,
          "fib":true,
          "ip":"10.0.0.1",
          "afi":"ipv4",
          "interfaceIndex":75,
          "interfaceName":"PortChannel0002",
          "active":true,
          "weight":1
        },
        {
          "flags":3,
          "fib":true,
          "ip":"10.0.0.5",
          "afi":"ipv4",
          "interfaceIndex":76,
          "interfaceName":"PortChannel0005",
          "active":true,
          "weight":1
        }
      ]
    }
  ]
}

Describe the results you expected:

Expect the output to be the same format as with SONIC_IFACE_CLI_MODE set to default

admin@vlab-08:~$ SONIC_IFACE_CLI_MODE=default show ip route 192.168.1.1
Routing entry for 0.0.0.0/0
  Known via "bgp", distance 20, metric 0, best
  Last update 20:39:14 ago
  * 10.0.0.5, via PortChannel0005
  * 10.0.0.1, via PortChannel0002

Routing entry for 0.0.0.0/0
  Known via "static", distance 200, metric 0
  Last update 20:39:14 ago
  * 10.250.0.1 inactive

Output of show version:

On a multi-asic KVM

admin@vlab-08:~$ show version

SONiC Software Version: SONiC.official_masic_test.24903-74c2532a
Distribution: Debian 10.10
Kernel: 4.19.0-12-2-amd64
Build commit: 74c2532a
Build date: Thu Jul 22 03:49:09 UTC 2021
Built by: AzDevOps@sonic-build-workers-000IRK

Platform: x86_64-kvm_x86_64-r0
HwSKU: msft_four_asic_vs
ASIC: vs
ASIC Count: 4
Serial Number: None
Model Number: None
Hardware Revision: None
Uptime: 15:42:29 up 12 days, 20:44,  1 user,  load average: 0.30, 0.16, 0.11

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

abdosi pushed a commit to sonic-net/sonic-utilities that referenced this issue Nov 18, 2022
… mode issue (#2422)

There are many issues with the "SONIC_CLI_IFACE_MODE=aliasshow ip/ipv6 route [json]" commands on both single asic platform and multiasic platform

Doesn't show the interface alias on single asic platform
Display the route info twice either in Json format or default format on the single asic platform
Doesn't show the interface alias on multiasic platform
Display the route info in the Json format even if Json is not specified in the CLI command
Resolves# sonic-net/sonic-buildimage#8498
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this issue Nov 21, 2022
… mode issue (sonic-net#2422)

There are many issues with the "SONIC_CLI_IFACE_MODE=aliasshow ip/ipv6 route [json]" commands on both single asic platform and multiasic platform

Doesn't show the interface alias on single asic platform
Display the route info twice either in Json format or default format on the single asic platform
Doesn't show the interface alias on multiasic platform
Display the route info in the Json format even if Json is not specified in the CLI command
Resolves# sonic-net/sonic-buildimage#8498
mdanish-kh pushed a commit to mdanish-kh/sonic-utilities that referenced this issue Nov 23, 2022
… mode issue (sonic-net#2422)

There are many issues with the "SONIC_CLI_IFACE_MODE=aliasshow ip/ipv6 route [json]" commands on both single asic platform and multiasic platform

Doesn't show the interface alias on single asic platform
Display the route info twice either in Json format or default format on the single asic platform
Doesn't show the interface alias on multiasic platform
Display the route info in the Json format even if Json is not specified in the CLI command
Resolves# sonic-net/sonic-buildimage#8498
yxieca pushed a commit to sonic-net/sonic-utilities that referenced this issue Nov 29, 2022
… mode issue (#2422)

There are many issues with the "SONIC_CLI_IFACE_MODE=aliasshow ip/ipv6 route [json]" commands on both single asic platform and multiasic platform

Doesn't show the interface alias on single asic platform
Display the route info twice either in Json format or default format on the single asic platform
Doesn't show the interface alias on multiasic platform
Display the route info in the Json format even if Json is not specified in the CLI command
Resolves# sonic-net/sonic-buildimage#8498
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this issue Aug 3, 2023
… mode issue (#2422)

There are many issues with the "SONIC_CLI_IFACE_MODE=aliasshow ip/ipv6 route [json]" commands on both single asic platform and multiasic platform

Doesn't show the interface alias on single asic platform
Display the route info twice either in Json format or default format on the single asic platform
Doesn't show the interface alias on multiasic platform
Display the route info in the Json format even if Json is not specified in the CLI command
Resolves# sonic-net/sonic-buildimage#8498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted 🆘 regression Triaged this issue has been triaged
Projects
None yet
Development

No branches or pull requests

2 participants