Skip to content

Multi-ASIC support for show ip(v6) route (201911 branch)#1283

Merged
gechiang merged 3 commits intosonic-net:201911from
gechiang:201911
Dec 8, 2020
Merged

Multi-ASIC support for show ip(v6) route (201911 branch)#1283
gechiang merged 3 commits intosonic-net:201911from
gechiang:201911

Conversation

@gechiang
Copy link
Contributor

@gechiang gechiang commented Dec 3, 2020

Add Multi-ASIC support to handle "show ip/ipv6 route" on multi-ASIC devices
Porting (#1216) to 201911 branch
Signed-off-by: Gen-Hwa Chiang [email protected]

- What I did

Add support for multi ASIC CLI options for "show ip/ipv6 route"
2 new options have added

[-n, --namespace] to allow user to display the information for given namespaces (ASIC)
If this option is not present the information from all the namespaces will be displayed

[-d, --display] to allow user to display ip routes related with nexthop that are going through both internal and external interfaces
If this option is not present only ip routes with external interfaces as its nexthop will be display

On single ASIC platform, this options are not valid, so the behavior remains unchanged

- How I did it

  • Request the back-end handler (FRR/Zebra) via the specified BGP docker(s) to dump out the "show ip/ipv6 route" in "json" format
  • Depends on the -d option optionally filter out those route nexthops that are via internal (back-end) interfaces.
  • If after filtering there are no next hops left, then skip that particular route from being displayed as well.
  • At the end of the filtering if user also specified "json" option, then just dump out in json format.
  • If user did not specify "json" option, then interpret the route output similar to how FRR/Zebra does and print out each route.
  • For Multi-ASIC platform if user specified "-d all" option, then the routes from all name spaces will be displayed ASIS without any filtering. Each namespace will be delimited with its own ASIC keyword first before displaying the routes for that name space. If the user requested in json format, then the json file will be formed as a dictionary of name space dictionaries of routes in json format.

- How to verify it

  • Mocked test cases were added to validate the functionality of the changes.
  • Manually tested on Multi-ASIC platform as well as pizzabox platforms.

Help menu

admin@sonic:~$ show ip route -h
Usage: show ip route [OPTIONS] [IPADDRESS] [vrf <vrf_name>] [...]

  Show IP (IPv4) routing table

Options:
  -d, --display TEXT    all|frontend
  -n, --namespace TEXT  Namespace name or all
  --verbose             Enable verbose output
  -?, -h, --help        Show this message and exit.
admin@sonic:~$

show ip route for all routes (include routes that uses internal interface as nexthop) from ASIC0 in multi ASIC device

admin@sonic:~$ show ip route -n asic0 -d all
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, q - queued route, r - rejected route

C>*10.106.0.4/31 is directly connected, PortChannel1005, 1d00h03m
B>*10.10.192.48/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
C>*10.0.107.16/32 is directly connected, Loopback4096, 1d00h03m
B>*10.0.107.18/32 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                       via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.46/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.106.0.12/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                       via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.52/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.62/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.38/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
K>*0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h03m
B>*10.10.192.36/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.54/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.0.107.21/32 [200/0] via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.0.107.8/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                      via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.106.0.8/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                      via 10.0.107.2, PortChannel4002, 1d00h03m
C>*10.0.107.0/31 is directly connected, PortChannel4001, 1d00h03m
B>*10.10.192.44/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.68/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.0.107.10/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                       via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.64/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
C>*172.16.132.64/32 is directly connected, Loopback0, 1d00h03m
B>*10.10.192.60/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.50/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.34/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.0.107.12/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                       via 10.0.107.2, PortChannel4002, 1d00h03m
C>*10.0.107.2/31 is directly connected, PortChannel4002, 1d00h03m
B>*10.0.107.17/32 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                       via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.0.107.4/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                      via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.42/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.0.107.19/32 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                       via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.0.107.14/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                       via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.66/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.70/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.32/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
C>*10.106.0.0/31 is directly connected, PortChannel1002, 1d00h03m
B>*10.0.107.6/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                      via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.56/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.40/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.10.192.58/31 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
  *                        via 10.0.107.2, PortChannel4002, 1d00h03m
B>*10.0.107.20/32 [200/0] via 10.0.107.0, PortChannel4001, 1d00h03m
admin@sonic:~$

show ip route (exclude routes that uses internal interface as nexthop) from ASIC0 in multi ASIC device

admin@sonic:~$ show ip route -n asic0
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, q - queued route, r - rejected route

C>*10.106.0.4/31 is directly connected, PortChannel1005, 1d00h03m
K>*0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h04m
C>*10.106.0.0/31 is directly connected, PortChannel1002, 1d00h03m
C>*172.16.132.64/32 is directly connected, Loopback0, 1d00h04m
C>*10.0.107.16/32 is directly connected, Loopback4096, 1d00h04m
admin@sonic:~$

show ip route (exclude routes that uses internal interface as nexthop) from ASIC5 in multi ASIC device in json format

admin@sonic:~$ show ip route -n asic5 json
{
  "10.0.107.21/32": [
    {
      "distance": 0,
      "uptime": "1d00h06m",
      "destSelected": true,
      "protocol": "connected",
      "internalFlags": 8,
      "metric": 0,
      "selected": true,
      "installed": true,
      "internalNextHopNum": 1,
      "prefix": "10.0.107.21/32",
      "internalNextHopActiveNum": 1,
      "table": 254,
      "internalStatus": 16,
      "nexthops": [
        {
          "directlyConnected": true,
          "interfaceName": "Loopback4096",
          "interfaceIndex": 9,
          "fib": true,
          "flags": 3,
          "active": true
        }
      ]
    }
  ],
  "172.16.132.64/32": [
    {
      "distance": 0,
      "uptime": "1d00h06m",
      "destSelected": true,
      "protocol": "connected",
      "internalFlags": 8,
      "metric": 0,
      "selected": true,
      "installed": true,
      "internalNextHopNum": 1,
      "prefix": "172.16.132.64/32",
      "internalNextHopActiveNum": 1,
      "table": 254,
      "internalStatus": 16,
      "nexthops": [
        {
          "directlyConnected": true,
          "interfaceName": "Loopback0",
          "interfaceIndex": 8,
          "fib": true,
          "flags": 3,
          "active": true
        }
      ]
    }
  ],
  "10.0.107.14/31": [
    {
      "distance": 200,
      "uptime": "1d00h05m",
      "protocol": "bgp",
      "internalFlags": 5,
      "metric": 0,
      "internalStatus": 0,
      "internalNextHopNum": 1,
      "prefix": "10.0.107.14/31",
      "internalNextHopActiveNum": 0,
      "table": 254,
      "nexthops": [
        {
          "ip": "10.0.107.15",
          "flags": 0,
          "afi": "ipv4"
        }
      ]
    }
  ],
  "10.0.107.2/31": [
    {
      "distance": 200,
      "uptime": "1d00h06m",
      "protocol": "bgp",
      "internalFlags": 5,
      "metric": 0,
      "internalStatus": 0,
      "internalNextHopNum": 1,
      "prefix": "10.0.107.2/31",
      "internalNextHopActiveNum": 0,
      "table": 254,
      "nexthops": [
        {
          "ip": "10.0.107.3",
          "flags": 0,
          "afi": "ipv4"
        }
      ]
    }
  ],
  "10.0.107.10/31": [
    {
      "distance": 200,
      "uptime": "1d00h05m",
      "protocol": "bgp",
      "internalFlags": 5,
      "metric": 0,
      "internalStatus": 0,
      "internalNextHopNum": 1,
      "prefix": "10.0.107.10/31",
      "internalNextHopActiveNum": 0,
      "table": 254,
      "nexthops": [
        {
          "ip": "10.0.107.11",
          "flags": 0,
          "afi": "ipv4"
        }
      ]
    }
  ],
  "10.0.107.6/31": [
    {
      "distance": 200,
      "uptime": "1d00h06m",
      "protocol": "bgp",
      "internalFlags": 5,
      "metric": 0,
      "internalStatus": 0,
      "internalNextHopNum": 1,
      "prefix": "10.0.107.6/31",
      "internalNextHopActiveNum": 0,
      "table": 254,
      "nexthops": [
        {
          "ip": "10.0.107.7",
          "flags": 0,
          "afi": "ipv4"
        }
      ]
    }
  ],
  "0.0.0.0/0": [
    {
      "distance": 210,
      "uptime": "1d00h06m",
      "destSelected": true,
      "protocol": "kernel",
      "internalFlags": 8,
      "metric": 0,
      "selected": true,
      "installed": true,
      "internalNextHopNum": 1,
      "prefix": "0.0.0.0/0",
      "internalNextHopActiveNum": 1,
      "table": 254,
      "internalStatus": 16,
      "nexthops": [
        {
          "interfaceName": "eth0",
          "ip": "240.127.1.1",
          "interfaceIndex": 13,
          "fib": true,
          "flags": 3,
          "active": true,
          "afi": "ipv4"
        }
      ]
    }
  ]
}
admin@sonic:~$

show ip route (exclude routes that uses internal interface as nexthop) from ASIC5 in multi ASIC device

admin@sonic:~$ show ip route -n asic5
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, q - queued route, r - rejected route

C>*10.0.107.21/32 is directly connected, Loopback4096, 1d00h06m
C>*172.16.132.64/32 is directly connected, Loopback0, 1d00h06m
B 10.0.107.14/31 [200/0] via 10.0.107.15, inactive 1d00h06m
B 10.0.107.2/31 [200/0] via 10.0.107.3, inactive 1d00h06m
B 10.0.107.10/31 [200/0] via 10.0.107.11, inactive 1d00h06m
B 10.0.107.6/31 [200/0] via 10.0.107.7, inactive 1d00h06m
K>*0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h07m
admin@sonic:~$

show ip route for all routes (exclude routes that uses internal interface as nexthop) from ALL ASICs in multi ASIC device

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, q - queued route, r - rejected route

C>*10.106.0.4/31 is directly connected, PortChannel1005, 1d00h04m
K>*0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h05m
C>*10.106.0.0/31 is directly connected, PortChannel1002, 1d00h04m
C>*172.16.132.64/32 is directly connected, Loopback0, 1d00h04m
C>*10.0.107.16/32 is directly connected, Loopback4096, 1d00h04m
C>*10.106.0.8/31 is directly connected, PortChannel1008, 1d00h04m
K>*0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h05m
C>*10.106.0.12/31 is directly connected, PortChannel1011, 1d00h04m
C>*172.16.132.64/32 is directly connected, Loopback0, 1d00h04m
C>*10.0.107.17/32 is directly connected, Loopback4096, 1d00h04m
C>*10.10.192.34/31 is directly connected, PortChannel1003, 1d00h04m
C>*10.10.192.48/31 is directly connected, PortChannel1013, 1d00h04m
C>*10.10.192.36/31 is directly connected, PortChannel1004, 1d00h04m
C>*10.10.192.32/31 is directly connected, PortChannel1001, 1d00h04m
C>*10.0.107.18/32 is directly connected, Loopback4096, 1d00h04m
C>*10.10.192.46/31 is directly connected, PortChannel1012, 1d00h04m
C>*10.10.192.44/31 is directly connected, PortChannel1010, 1d00h04m
C>*10.10.192.50/31 is directly connected, PortChannel1014, 1d00h04m
C>*10.10.192.38/31 is directly connected, PortChannel1006, 1d00h04m
K>*0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h04m
C>*10.10.192.40/31 is directly connected, PortChannel1007, 1d00h04m
C>*10.10.192.42/31 is directly connected, PortChannel1009, 1d00h04m
C>*172.16.132.64/32 is directly connected, Loopback0, 1d00h04m
C>*10.10.192.54/31 is directly connected, PortChannel1016, 1d00h04m
C>*10.0.107.19/32 is directly connected, Loopback4096, 1d00h04m
C>*172.16.132.64/32 is directly connected, Loopback0, 1d00h04m
C>*10.10.192.62/31 is directly connected, PortChannel1020, 1d00h04m
C>*10.10.192.60/31 is directly connected, PortChannel1019, 1d00h04m
C>*10.10.192.70/31 is directly connected, PortChannel1024, 1d00h04m
C>*10.10.192.68/31 is directly connected, PortChannel1023, 1d00h04m
C>*10.10.192.52/31 is directly connected, PortChannel1015, 1d00h04m
K>*0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h05m
C>*10.10.192.66/31 is directly connected, PortChannel1022, 1d00h04m
C>*10.10.192.58/31 is directly connected, PortChannel1018, 1d00h04m
C>*10.10.192.64/31 is directly connected, PortChannel1021, 1d00h04m
C>*10.10.192.56/31 is directly connected, PortChannel1017, 1d00h04m
C>*172.16.132.64/32 is directly connected, Loopback0, 1d00h04m
B 10.0.107.8/31 [200/0] via 10.0.107.9, inactive 1d00h04m
B 10.0.107.0/31 [200/0] via 10.0.107.1, inactive 1d00h04m
B 10.0.107.12/31 [200/0] via 10.0.107.13, inactive 1d00h04m
K>*0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h05m
B 10.0.107.4/31 [200/0] via 10.0.107.5, inactive 1d00h04m
C>*10.0.107.20/32 is directly connected, Loopback4096, 1d00h04m
C>*10.0.107.21/32 is directly connected, Loopback4096, 1d00h04m
C>*172.16.132.64/32 is directly connected, Loopback0, 1d00h04m
B 10.0.107.14/31 [200/0] via 10.0.107.15, inactive 1d00h04m
B 10.0.107.2/31 [200/0] via 10.0.107.3, inactive 1d00h04m
B 10.0.107.10/31 [200/0] via 10.0.107.11, inactive 1d00h04m
B 10.0.107.6/31 [200/0] via 10.0.107.7, inactive 1d00h04m
K>*0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h05m
admin@sonic:~$

show ip route for all routes (include routes that uses internal interface as nexthop) from ALL ASICs in multi ASIC device

admin@SONiC:~$ show ip route -d all
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, q - queued route, r - rejected route

asic0:
K *0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h13m
B>*0.0.0.0/0 [20/0] via 10.0.0.5, PortChannel0005, 23:15:00
  *                 via 10.0.0.1, PortChannel0002, 23:15:00
S 0.0.0.0/0 [200/0] via 10.3.146.1, inactive 23:15:00
C>*8.0.0.0/32 is directly connected, Loopback4096, 23:15:44
B>*8.0.0.1/32 [200/0] via 10.1.0.2, PortChannel4002, 23:12:40
  *                   via 10.1.0.0, PortChannel4001, 23:12:40
B>*8.0.0.2/32 [200/0] via 10.1.0.2, PortChannel4002, 23:12:40
  *                   via 10.1.0.0, PortChannel4001, 23:12:40
B>*8.0.0.3/32 [200/0] via 10.1.0.2, PortChannel4002, 23:12:40
  *                   via 10.1.0.0, PortChannel4001, 23:12:40
B>*8.0.0.4/32 [200/0] via 10.1.0.0, PortChannel4001, 23:13:20
B>*8.0.0.5/32 [200/0] via 10.1.0.2, PortChannel4002, 23:12:56
C>*10.0.0.0/31 is directly connected, PortChannel0002, 23:15:04
C>*10.0.0.4/31 is directly connected, PortChannel0005, 23:15:03
B>*10.0.0.8/31 [200/0] via 10.1.0.2, PortChannel4002, 23:12:40
  *                    via 10.1.0.0, PortChannel4001, 23:12:40
B>*10.0.0.12/31 [200/0] via 10.1.0.2, PortChannel4002, 23:12:40
  *                     via 10.1.0.0, PortChannel4001, 23:12:40
...
B>*200.0.1.0/26 [200/0] via 10.1.0.2, PortChannel4002, 23:12:40
  *                     via 10.1.0.0, PortChannel4001, 23:12:40

asic1:
K *0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h13m
B>*0.0.0.0/0 [20/0] via 10.0.0.13, PortChannel0011, 23:15:00
  *                 via 10.0.0.9, PortChannel0008, 23:15:00
S 0.0.0.0/0 [200/0] via 10.3.146.1, inactive 23:15:00
B>*8.0.0.0/32 [200/0] via 10.1.0.6, PortChannel4004, 23:12:29
  *                   via 10.1.0.4, PortChannel4003, 23:12:29
C>*8.0.0.1/32 is directly connected, Loopback4096, 23:15:23
B>*8.0.0.2/32 [200/0] via 10.1.0.6, PortChannel4004, 23:12:28
  *                   via 10.1.0.4, PortChannel4003, 23:12:28
B>*8.0.0.3/32 [200/0] via 10.1.0.6, PortChannel4004, 23:12:28
  *                   via 10.1.0.4, PortChannel4003, 23:12:28
B>*8.0.0.4/32 [200/0] via 10.1.0.4, PortChannel4003, 23:13:22
B>*8.0.0.5/32 [200/0] via 10.1.0.6, PortChannel4004, 23:12:58
B>*10.0.0.0/31 [200/0] via 10.1.0.6, PortChannel4004, 23:12:29
  *                    via 10.1.0.4, PortChannel4003, 23:12:29
...
B>*192.168.199.241/32 [20/0] via 10.0.0.13, PortChannel0011, 23:14:57
  *                          via 10.0.0.9, PortChannel0008, 23:14:57
B>*200.0.1.0/26 [200/0] via 10.1.0.6, PortChannel4004, 23:12:28
  *                     via 10.1.0.4, PortChannel4003, 23:12:28

asic2:
K *0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h14m
B>*0.0.0.0/0 [200/0] via 10.1.0.10, PortChannel4006, 23:11:15
  *                  via 10.1.0.8, PortChannel4005, 23:11:15
S 0.0.0.0/0 [200/0] via 10.3.146.1, inactive 23:11:15
B>*8.0.0.0/32 [200/0] via 10.1.0.10, PortChannel4006, 23:11:16
  *                   via 10.1.0.8, PortChannel4005, 23:11:16
B>*8.0.0.1/32 [200/0] via 10.1.0.10, PortChannel4006, 23:11:15
  *                   via 10.1.0.8, PortChannel4005, 23:11:15
C>*8.0.0.2/32 is directly connected, Loopback4096, 23:14:51
B>*8.0.0.3/32 [200/0] via 10.1.0.10, PortChannel4006, 23:11:15
  *                   via 10.1.0.8, PortChannel4005, 23:11:15
B>*8.0.0.4/32 [200/0] via 10.1.0.8, PortChannel4005, 23:13:26
B>*8.0.0.5/32 [200/0] via 10.1.0.10, PortChannel4006, 23:13:01
B>*10.0.0.0/31 [200/0] via 10.1.0.10, PortChannel4006, 23:11:16
  *                    via 10.1.0.8, PortChannel4005, 23:11:16
...
B>*192.168.199.241/32 [200/0] via 10.1.0.10, PortChannel4006, 23:11:16
  *                           via 10.1.0.8, PortChannel4005, 23:11:16
B>*200.0.1.0/26 [20/0] via 10.0.0.41, PortChannel0007, 23:14:40
  *                    via 10.0.0.37, PortChannel0004, 23:14:40

asic3:
K *0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h14m
B>*0.0.0.0/0 [200/0] via 10.1.0.14, PortChannel4008, 23:11:35
  *                  via 10.1.0.12, PortChannel4007, 23:11:35
S 0.0.0.0/0 [200/0] via 10.3.146.1, inactive 23:11:35
B>*8.0.0.0/32 [200/0] via 10.1.0.14, PortChannel4008, 23:11:36
  *                   via 10.1.0.12, PortChannel4007, 23:11:36
B>*8.0.0.1/32 [200/0] via 10.1.0.14, PortChannel4008, 23:11:35
  *                   via 10.1.0.12, PortChannel4007, 23:11:35
B>*8.0.0.2/32 [200/0] via 10.1.0.14, PortChannel4008, 23:11:35
  *                   via 10.1.0.12, PortChannel4007, 23:11:35
C>*8.0.0.3/32 is directly connected, Loopback4096, 23:14:33
B>*8.0.0.4/32 [200/0] via 10.1.0.12, PortChannel4007, 23:13:26
B>*8.0.0.5/32 [200/0] via 10.1.0.14, PortChannel4008, 23:12:20
B>*10.0.0.0/31 [200/0] via 10.1.0.14, PortChannel4008, 23:11:36
  *                    via 10.1.0.12, PortChannel4007, 23:11:36
...
B>*192.168.199.241/32 [200/0] via 10.1.0.14, PortChannel4008, 23:11:36
  *                           via 10.1.0.12, PortChannel4007, 23:11:36
B>*200.0.1.0/26 [200/0] via 10.1.0.14, PortChannel4008, 23:11:35
  *                     via 10.1.0.12, PortChannel4007, 23:11:35

asic4:
K *0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h14m
B>*0.0.0.0/0 [200/0] via 10.1.0.5, PortChannel4010, 23:13:34
  *                  via 10.1.0.1, PortChannel4009, 23:13:34
S 0.0.0.0/0 [200/0] via 10.3.146.1, inactive 23:13:34
B>*8.0.0.0/32 [200/0] via 10.1.0.1, PortChannel4009, 23:13:35
B>*8.0.0.1/32 [200/0] via 10.1.0.5, PortChannel4010, 23:13:34
B>*8.0.0.2/32 [200/0] via 10.1.0.9, PortChannel4011, 23:13:34
B>*8.0.0.3/32 [200/0] via 10.1.0.13, PortChannel4012, 23:13:30
C>*8.0.0.4/32 is directly connected, Loopback4096, 23:14:03
B>*10.0.0.0/31 [200/0] via 10.1.0.1, PortChannel4009, 23:13:35
B>*10.0.0.4/31 [200/0] via 10.1.0.1, PortChannel4009, 23:13:35
...
B>*192.168.199.241/32 [200/0] via 10.1.0.5, PortChannel4010, 23:13:34
  *                           via 10.1.0.1, PortChannel4009, 23:13:34
B>*200.0.1.0/26 [200/0] via 10.1.0.9, PortChannel4011, 23:13:11

asic5:
K *0.0.0.0/0 [210/0] via 240.127.1.1, eth0, 1d00h14m
B>*0.0.0.0/0 [200/0] via 10.1.0.7, PortChannel4014, 23:13:13
  *                  via 10.1.0.3, PortChannel4013, 23:13:13
S 0.0.0.0/0 [200/0] via 10.3.146.1, inactive 23:13:13
B>*8.0.0.0/32 [200/0] via 10.1.0.3, PortChannel4013, 23:13:14
B>*8.0.0.1/32 [200/0] via 10.1.0.7, PortChannel4014, 23:13:13
B>*8.0.0.2/32 [200/0] via 10.1.0.11, PortChannel4015, 23:13:13
B>*8.0.0.3/32 [200/0] via 10.1.0.15, PortChannel4016, 23:13:13
C>*8.0.0.5/32 is directly connected, Loopback4096, 23:13:46
B>*10.0.0.0/31 [200/0] via 10.1.0.3, PortChannel4013, 23:13:14
B>*10.0.0.4/31 [200/0] via 10.1.0.3, PortChannel4013, 23:13:14
...
B>*192.168.199.241/32 [200/0] via 10.1.0.7, PortChannel4014, 23:13:14
  *                           via 10.1.0.3, PortChannel4013, 23:13:14
B>*200.0.1.0/26 [200/0] via 10.1.0.11, PortChannel4015, 23:12:12

admin@SONiC:~$

show ipv6 route for specific route from all ASICs (include routes that uses internal interface as nexthop) in multi ASIC device

admin@SONiC:~$ show ipv6 route 20c0:a8c7:0:80:: -d all
asic0:
Routing entry for 20c0:a8c7:0:80::/64
  Known via "bgp", distance 20, metric 0, best
  Last update 23:29:15 ago
  * fc00::6, via PortChannel0005
  * fc00::2, via PortChannel0002


asic1:
Routing entry for 20c0:a8c7:0:80::/64
  Known via "bgp", distance 20, metric 0, best
  Last update 23:29:06 ago
  * fc00::e, via PortChannel0011
  * fc00::a, via PortChannel0008


asic2:
Routing entry for 20c0:a8c7:0:80::/64
  Known via "bgp", distance 200, metric 0, best
  Last update 23:26:20 ago
  * 2603:10e2:400:1::15, via PortChannel4006
  * 2603:10e2:400:1::11, via PortChannel4005


asic3:
Routing entry for 20c0:a8c7:0:80::/64
  Known via "bgp", distance 200, metric 0, best
  Last update 23:26:26 ago
  * 2603:10e2:400:1::1d, via PortChannel4008
  * 2603:10e2:400:1::19, via PortChannel4007


asic4:
Routing entry for 20c0:a8c7:0:80::/64
  Known via "bgp", distance 200, metric 0, best
  Last update 23:27:37 ago
  * 2603:10e2:400:1::a, via PortChannel4010
  * 2603:10e2:400:1::2, via PortChannel4009


asic5:
Routing entry for 20c0:a8c7:0:80::/64
  Known via "bgp", distance 200, metric 0, best
  Last update 23:27:12 ago
  * 2603:10e2:400:1::e, via PortChannel4014
  * 2603:10e2:400:1::6, via PortChannel4013


admin@SONiC:~$

show ip route for specific route from all ASICs and how that is combined when only front-end interface filtering applied

admin@SONiC:~$ show ip route 192.168.199.96 -d all
asic0:
Routing entry for 192.168.199.96/32
  Known via "bgp", distance 20, metric 0, best
  Last update 11:48:27 ago
  * 10.0.0.5, via PortChannel0005
  * 10.0.0.1, via PortChannel0002


asic1:
Routing entry for 192.168.199.96/32
  Known via "bgp", distance 20, metric 0, best
  Last update 11:48:34 ago
  * 10.0.0.13, via PortChannel0011
  * 10.0.0.9, via PortChannel0008


asic2:
Routing entry for 192.168.199.96/32
  Known via "bgp", distance 200, metric 0, best
  Last update 11:46:39 ago
  * 10.1.0.10, via PortChannel4006
  * 10.1.0.8, via PortChannel4005


asic3:
Routing entry for 192.168.199.96/32
  Known via "bgp", distance 200, metric 0, best
  Last update 11:46:41 ago
  * 10.1.0.14, via PortChannel4008
  * 10.1.0.12, via PortChannel4007


asic4:
Routing entry for 192.168.199.96/32
  Known via "bgp", distance 200, metric 0, best
  Last update 11:46:38 ago
  * 10.1.0.5, via PortChannel4010
  * 10.1.0.1, via PortChannel4009


asic5:
Routing entry for 192.168.199.96/32
  Known via "bgp", distance 200, metric 0, best
  Last update 11:46:41 ago
  * 10.1.0.7, via PortChannel4014
  * 10.1.0.3, via PortChannel4013


admin@SONiC:~$ show ip route 192.168.199.96 
Routing entry for 192.168.199.96/32
  Known via "bgp", distance 20, metric 0, best
  Last update 11:48:43 ago
  * 10.0.0.5, via PortChannel0005
  * 10.0.0.1, via PortChannel0002
  * 10.0.0.13, via PortChannel0011
  * 10.0.0.9, via PortChannel0008

admin@SONiC:~$ 

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

** Please Note **
This is the same PR that I raised previously "#1089" which I closed due to design was changed to handle IPV6 as well as the new "merge routes" criteria.

@lgtm-com
Copy link

lgtm-com bot commented Dec 3, 2020

This pull request introduces 2 alerts when merging 65c5c18 into 28399bf - view on LGTM.com

new alerts:

  • 1 for Unused local variable
  • 1 for Unused import

Copy link
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gechiang gechiang merged commit d09667b into sonic-net:201911 Dec 8, 2020
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
ccb5245 (HEAD -> 201911, origin/201911) [fast-reboot] Fix fast-reboot when NDP entries are present (sonic-net#1295)
d09667b Multi-ASIC support for show ip(v6) route (201911 branch) (sonic-net#1283)
28399bf [201911-Mellanox] SKU creator Tool (sonic-net#1163) (sonic-net#1250)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants