Question

VRF routing table in json format issue [Cumulus VX 3.7.6]

  • 28 June 2019
  • 1 reply
  • 91 views

Hi all! I seem to get a strange json format whenever I try to output the routing tables for all the VRFs configured on my device using the NCLU (i.e., $ net show route vrf all json). As opposed to this, the output is totally correct when I try to display the routing table for each individual VRF (e.g., $ net show route vrf distribution json).
The output for both commands is displayed blow. Any thoughts?

Mention: I am using the Cumulus VX 3.7.6 with KVM on an x86 server.



$ net show route vrf all json
{
"ipv4 unicast": "{\n \"0.0.0.0\\/0\":[\n {\n \"prefix\":\"0.0.0.0\\/0\",\n \"protocol\":\"kernel\",\n \"selected\":true,\n \"distance\":0,\n \"metric\":0,\n \"uptime\":\"1d02h06m\",\n \"nexthops\":[\n {\n \"fib\":true,\n \"ip\":\"172.20.190.1\",\n \"afi\":\"ipv4\",\n \"interfaceIndex\":2,\n \"interfaceName\":\"eth0\",\n \"active\":true\n }\n ]\n }\n ],\n \"172.20.190.1\\/24\":[\n {\n \"prefix\":\"172.20.190.1\\/24\",\n \"protocol\":\"connected\",\n \"selected\":true,\n \"uptime\":\"1d02h06m\",\n \"nexthops\":[\n {\n \"fib\":true,\n \"directlyConnected\":true,\n \"interfaceIndex\":2,\n \"interfaceName\":\"eth0\",\n \"active\":true\n }\n ]\n }\n ]\n}\n{\n \"0.0.0.0\\/0\":[\n {\n \"prefix\":\"0.0.0.0\\/0\",\n \"protocol\":\"kernel\",\n \"vrfId\":5,\n \"distance\":255,\n \"metric\":8192,\n \"uptime\":\"1d02h06m\",\n \"nexthops\":[\n {\n \"fib\":true,\n \"unreachable\":true,\n \"reject\":true,\n \"active\":true\n }\n ]\n }\n ]\n}\n{\n \"0.0.0.0\\/0\":[\n {\n \"prefix\":\"0.0.0.0\\/0\",\n \"protocol\":\"kernel\",\n \"vrfId\":6,\n \"distance\":255,\n \"metric\":8192,\n \"uptime\":\"1d02h06m\",\n \"nexthops\":[\n {\n \"fib\":true,\n \"unreachable\":true,\n \"reject\":true,\n \"active\":true\n }\n ]\n }\n ]\n}\n{\n \"0.0.0.0\\/0\":[\n {\n \"prefix\":\"0.0.0.0\\/0\",\n \"protocol\":\"kernel\",\n \"vrfId\":7,\n \"distance\":255,\n \"metric\":8192,\n \"uptime\":\"1d02h06m\",\n \"nexthops\":[\n {\n \"fib\":true,\n \"unreachable\":true,\n \"reject\":true,\n \"active\":true\n }\n ]\n }\n ],\n \"10.199.99.0\\/24\":[\n {\n \"prefix\":\"10.99.99.0\\/24\",\n \"protocol\":\"connected\",\n \"vrfId\":7,\n \"selected\":true,\n \"uptime\":\"01:02:55\",\n \"nexthops\":[\n {\n \"fib\":true,\n \"directlyConnected\":true,\n \"interfaceIndex\":3,\n \"interfaceName\":\"swp1\",\n \"active\":true\n }\n ]\n }\n ]\n}\n"
} ...


$ net show route vrf distribution json
{
"ipv4 unicast": {
"0.0.0.0/0": [
{
"distance": 255,
"metric": 8192,
"nexthops": [
{
"active": true,
"fib": true,
"reject": true,
"unreachable": true
}
],
"prefix": "0.0.0.0/0",
"protocol": "kernel",
"uptime": "1d02h11m",
"vrfId": 5
}
]
},
"ipv6 unicast": {
"::/0": [
{
"distance": 255,
"metric": 8192,
"nexthops": [
{
"active": true,
"fib": true,
"reject": true,
"unreachable": true
}
],
"prefix": "::/0",
"protocol": "kernel",
"uptime": "1d02h11m",
"vrfId": 5
}
]
}
}

1 reply

Try `net show route vrf all json | python -m json.tool`

Reply