summaryrefslogtreecommitdiff
path: root/zebra/zebra_vty.c
AgeCommit message (Collapse)Author
2024-10-27lib, zebra: Keep `zebra on-rib-process script` in frr.confDonatas Abraitis
After the change: ``` $ grep on-rib-process /etc/frr/frr.conf zebra on-rib-process script script4 $ systemctl restart frr $ vtysh -c 'show run' | grep on-rib-process zebra on-rib-process script script4 ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 1fe1f8d87c4ab46ae18536a2418c05ae5fd95185)
2024-07-23zebra: Properly note that a nhg's nexthop has gone downDonald Sharp
Current code when a link is set down is to just mark the nexthop group as not properly setup. Leaving situations where when an interface goes down and show output is entered we see incorrect state. This is true for anything that would be checking those flags at that point in time. Modify the interface down nexthop group code to notice the nexthops appropriately ( and I mean set the appropriate flags ) and to allow a `show ip route` command to actually display what is going on with the nexthops. eva# show ip route 1.0.0.0 Routing entry for 1.0.0.0/32 Known via "sharp", distance 150, metric 0, best Last update 00:00:06 ago * 192.168.44.33, via dummy1, weight 1 * 192.168.45.33, via dummy2, weight 1 sharpd@eva:~/frr1$ sudo ip link set dummy2 down eva# show ip route 1.0.0.0 Routing entry for 1.0.0.0/32 Known via "sharp", distance 150, metric 0, best Last update 00:00:12 ago * 192.168.44.33, via dummy1, weight 1 192.168.45.33, via dummy2 inactive, weight 1 Notice now that the 1.0.0.0/32 route now correctly displays the route for the nexthop group entry. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit 266b0619942edd8d838235e14dc0cb71a772f585)
2024-06-07zebra: fix show route memory consumptionLouis Scalbert
When displaying a route table in JSON, a table JSON object is storing all the prefix JSON objects containing the prefix information. This results in excessive memory allocation for JSON objects, potentially leading to an out-of-memory error on the machine with large routing tables. To Fix the memory consumption issue for the "show ip[v6] route [vrf XX] json" command, display the prefixes one by one and free the memory of each JSON object after it has been displayed. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-07zebra: fix show route vrf all memory consumptionLouis Scalbert
0e2fc3d67f ("vtysh, zebra: Fix malformed json output for multiple vrfs in command 'show ip route vrf all json'") has been reverted in the previous commit. Although the fix was correct, it was consuming too muca memory when displaying large route tables. A root JSON object was storing all the JSON objects containing the route tables, each containing their respective prefixes in JSON objects. This resulted in excessive memory allocation for JSON objects, potentially leading to an out-of-memory error on the machine. To Fix the memory consumption issue for the "show ip[v6] route vrf all json" command, display the tables one by one and free the memory of each JSON object after it has been displayed. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-06-07Revert "vtysh, zebra: Fix malformed json output for multiple vrfs in command ↵Louis Scalbert
'show ip route vrf all json'" This reverts commit 0e2fc3d67f1d358896a764373f41cb59c095eda9. This fix was correct but not optimal for memory consumption at scale. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-05-14zebra: include route source set by route-map in show outputMark Stapp
Include the prefix source address when set by a route-map in show output for routes, in various formats. Add some debugs when encoding netlink route messages with a source address. Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-22lib: rework northbound RPC callbackIgor Ryzhov
Change input/output arguments of the RPC callback from lists of (xpath/value) tuples to YANG data trees. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-30zebra: Fix JSON output for `show route summary json`Donatas Abraitis
Before: ``` { "routes":[ { "fib":1, "rib":1, "fibOffLoaded":0, "fibTrapped":0, "type":"connected" }, { "fib":1, "rib":1, "fibOffLoaded":0, "fibTrapped":0, "type":"local" }, { "fib":2, "rib":2, "fibOffLoaded":0, "fibTrapped":0, "type":"static" } ], "routesTotal":4, "routesTotalFib":4 } { "routes":[ { "fib":2, "rib":2, "fibOffLoaded":0, "fibTrapped":0, "type":"connected" }, { "fib":2, "rib":2, "fibOffLoaded":0, "fibTrapped":0, "type":"local" }, { "fib":2, "rib":2, "fibOffLoaded":0, "fibTrapped":0, "type":"static" } ], "routesTotal":6, "routesTotalFib":6 } ``` After: ``` { "ISR":{ "routes":[ { "fib":1, "rib":1, "fibOffLoaded":0, "fibTrapped":0, "type":"connected" }, { "fib":1, "rib":1, "fibOffLoaded":0, "fibTrapped":0, "type":"local" }, { "fib":2, "rib":2, "fibOffLoaded":0, "fibTrapped":0, "type":"static" } ], "routesTotal":4, "routesTotalFib":4 }, "default":{ "routes":[ { "fib":2, "rib":2, "fibOffLoaded":0, "fibTrapped":0, "type":"connected" }, { "fib":2, "rib":2, "fibOffLoaded":0, "fibTrapped":0, "type":"local" }, { "fib":2, "rib":2, "fibOffLoaded":0, "fibTrapped":0, "type":"static" } ], "routesTotal":6, "routesTotalFib":6 } } ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-03-29vtysh, zebra: Fix malformed json output for multiple vrfs in command 'show ↵Piotr Suchy
ip route vrf all json' Command 'show ip route vrf <vrf_name> json' returns a valid json object, however if instead of <vrf_name> we specify 'all', we get an invalid json object, like: {//vrf1 routes}{//vrf2 routes}{vrf3 routes} After the fix: {"vrf1":{//vrf1 routes},"vrf2:{//vrf2 routes},"vrf3":{//vrf3 routes}} Which is a valid json object, that can be parsed effectively using built-in modules. The rest of the commands remains unaffected and behave the same. Signed-off-by: Piotr Suchy <psuchy@akamai.com>
2024-02-08zebra: When reinstalling a NHG, set REINSTALL flagDonald Sharp
The current code is unsetting the fact that the NHG is installed. It is installed but we are reinstalling it. Let's note this in the code appropriately as REINSTALL and not remove the INSTALLED FLAG. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-02-08zebra: Remove helper function if_nhg_dependents_is_emptyDonald Sharp
Let's just let the function figure this out. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-28zebra: convert to mgmtdIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert vrf configuration output to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert table range command to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert resolve-via-default commands to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: fix vni NB conversionIgor Ryzhov
- unnecessary command duplication - usage of oper data during validation - unnecessary checks for things that can't happen Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert interface configuration output to NBIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-12-05Merge pull request #12600 from donaldsharp/local_routesRuss White
*: Introduce Local Host Routes to FRR
2023-11-07*: Move distance related defines into their own headerDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-06zebra: When using Nexthop groups, use v6 RR semanticsDonald Sharp
The nexthop group route replace operation was made consistent across all versions of the kernel. A v6 route replacement does not need to do a delete than add when using nexthop groups Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-06zebra: Move v6_rr_semantics to be part of zrouter structureDonald Sharp
Move global variable v6_rr_semantics from a global data structure into the zrouter data structure. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-06zebra: Add v6_rr_semantics status to `show zebra`Donald Sharp
The v6_rr_semantics variable was being set but never reported and had to be inferred from watching netlink messages to the kernel. Let's add a bit of code to `show zebra` so that we can know how it is being used. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-01*: Introduce Local Host Routes to FRRDonald Sharp
Create Local routes in FRR: S 0.0.0.0/0 [1/0] via 192.168.119.1, enp39s0, weight 1, 00:03:46 K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:03:51 O 192.168.119.0/24 [110/100] is directly connected, enp39s0, weight 1, 00:03:46 C>* 192.168.119.0/24 is directly connected, enp39s0, 00:03:51 L>* 192.168.119.224/32 is directly connected, enp39s0, 00:03:51 O 192.168.119.229/32 [110/100] via 0.0.0.0, enp39s0 inactive, weight 1, 00:03:46 C>* 192.168.119.229/32 is directly connected, enp39s0, 00:03:46 Create ability to redistribute local routes. Modify tests to support this change. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-17zebra: Show NHT resolve via default status on/offDonatas Abraitis
``` donatas-laptop# show ip nht VRF default: Resolve via default: on 192.168.10.123 resolved via connected is directly connected, wlp82s0 (vrf default) Client list: bgp(fd 21) donatas-laptop# show ip nht json { "default":{ "ipv4":{ "resolveViaDefault":true, "192.168.10.123":{ "nhtConnected":false, "clientList":[ { "protocol":"bgp", "socket":21, "protocolFiltered":"none" } ], "nexthops":[ { "flags":3, "fib":true, "directlyConnected":true, "interfaceIndex":3, "interfaceName":"wlp82s0", "vrf":"default", "active":true } ], "resolvedProtocol":"connected" } } } } donatas-laptop# show ip nht vrf all VRF default: Resolve via default: on 192.168.10.123 resolved via connected is directly connected, wlp82s0 (vrf default) Client list: bgp(fd 21) donatas-laptop# show ip nht vrf all json { "default":{ "ipv4":{ "resolveViaDefault":true, "192.168.10.123":{ "nhtConnected":false, "clientList":[ { "protocol":"bgp", "socket":21, "protocolFiltered":"none" } ], "nexthops":[ { "flags":3, "fib":true, "directlyConnected":true, "interfaceIndex":3, "interfaceName":"wlp82s0", "vrf":"default", "active":true } ], "resolvedProtocol":"connected" } } } } donatas-laptop# ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-03zebra: Allow zebra cli to accept v6 routes with v4 nexthopsDonald Sharp
add --v6-with-v4-nexthop cli to zebra to allow operator to specify that this functionality is allowed. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21zebra: non pretty json output for show ip routeSindhu Parvathi Gopinathan
Currently, json output of show ip route command are no pretty format. This is an extremely expensive operation at high scale (with high number of routes with many paths). Zebra json non-pretty command support added: ``` show ip route json ``` Ticket:#3513256 Issue:3513256 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
2023-07-12zebra: remove unnecessary check for default vrfanlan_cs
The default vrf is generally non-NULL, except when shutdown. So, most of the time it is not necessary to check if it is NULL, we should remove the useless checks for it. Searched them with exact match: ``` grep -rI "zebra_vrf_lookup_by_id(VRF_DEFAULT)" | wc -l 31 ``` Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-03-28zebra: Use zebra_vrf_lookup_by_id when we canDonald Sharp
Let's make this as consistent as is possible. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert a bunch of thread_XX to event_XXDonald Sharp
Convert these functions: thread_getrusage thread_cmd_init thread_consumed_time thread_timer_to_hhmmss thread_is_scheduled thread_ignore_late_timer Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-21Merge pull request #12798 from donaldsharp/rib_match_multicastRuss White
Rib match multicast
2023-02-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-16doc: Add `show ipv6 rpf X:X::X:X` command to docsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-16zebra: Remove code duplication for v4 and v6 versions of rib_match_multicastDonald Sharp
a) Consolidate v4 and v6 versions of rib_match_multicast b) Improve debug to show what we matched against as well. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-15Merge pull request #12494 from louis-6wind/ext_admin_groupOlivier Dugeon
lib,zebra,isisd: add support for extended admin group RFC7308
2023-02-13zebra: make next-hop svd command hidden for nowStephen Worley
The `show evpn next-hop svd *` command doesn't provide much for users right now. Make it hidden so we can still debug the tables with it. Also remove SVD output from `show evpn next-hop vni all`. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13zebra: add show commands for SVD global neigh tableStephen Worley
Add some show commands and expand some already existing commands so we can get debug info from the SVD global neigh table inside zebra. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13lib,zebra,bgpd,staticd: use label code to store VNI infoStephen Worley
Use the already existing mpls label code to store VNI info for vxlan. VNI's are defined as labels just like mpls, we should be using the same code for both. This patch is the first part of that. Next we will need to abstract the label code to not be so mpls specific. Currently in this, we are just treating VXLAN as a label type and storing it that way. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13zebra: Bug fixes in vtysh doc string, mcast group handling and vni deletion ↵Sharath Ramamurthy
handling with single vxlan device This patch addresses following bug fixes - Fix vtysh doc string in "show evpn access-vlan..." command - Multicast group handling was little complex. This change avoids calling multiple functions and directly calls the zebra_vxlan_if_update_vni for mcast group updates. - When a vlan-vni map is removed, the removed vni deletion was happening in FRR with SVD config. This was resulting in stale vni and not resulting propagation of the vni deletion. During vni cleanup (zebra_vxlan_if_vni_clean) zebra_vxlan_if_vni_del was called for vni delete which is not correct. We should be calling zebra_vxlan_if_vni_entry_del for the given vni entry. Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
2023-02-13zebra: multiple vlan aware bridge data structure and related changesSharath Ramamurthy
Multiple vlan aware bridge data structure changes and its corresponding bridge handling changes. A new vlan-table is maintained for each bridge which records the zebra_l2_bridge_vlan entry. zebra_l2_bridge_vlan maps vlan to access_bd associated to this bridge. Existing zebra_evpn_access_bd structure is vlan aware which is now modified to be (vlan, bridge) aware. Whenever a new access_bd is instantiated, a corresponding entry is also recorded in the zebra l2 bridge for the vlan. When the access_bd is dereferenced or whenever a bridge is deleted, the association is cleaned up. Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
2023-02-10lib,zebra: add affinity-map configuration hooksLouis Scalbert
Add affinity-map hooks to check the utilization of affinity-map in link-params before its deletion and to update link-params when the affinity-map bit-position is updated. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-02-09lib,yang,zebra: add affinity-map supportLouis Scalbert
Add the affinity-map global command to zebra. The syntax is: > affinity-map NAME bit-position (0-1023) Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-31zebra: Add missing enums to switch statementsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-24zebra: fix JSON fields for "show ip/ipv6 nht"Pooja Jagadeesh Doijode
1. Renamed "gates" to "nexthops" 2. Displaying afi of the nexthops being dispalyed in place of "nexthops" JSON object in the old JSON output 3. Calling show_route_nexthop_helper() and show_nexthop_json_helper() instead of print_nh() inorder to keeps the fields in "nexthops" JSON object in sync with "nexthops" JSON object of "show nexthop-group rib json". Updated vtysh: r1# show ip nht 192.168.0.2 resolved via connected is directly connected, r1-eth0 (vrf default) Client list: static(fd 28) 192.168.0.4 resolved via connected is directly connected, r1-eth0 (vrf default) Client list: static(fd 28) Updated JSON: r1# show ip nht json { "default":{ "ipv4":{ "192.168.0.2":{ "nhtConnected":false, "clientList":[ { "protocol":"static", "socket":28, "protocolFiltered":"none" } ], "nexthops":[ { "flags":3, "fib":true, "directlyConnected":true, "interfaceIndex":2, "interfaceName":"r1-eth0", "vrf":"default", "active":true } ], "resolvedProtocol":"connected" } } } } Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-01-13zebra: Adding FRR support for show vrf vrf-id vniSindhu Parvathi Gopinathan
cli & json support extended for show vrf vrf-id vni commands: - existing: show vrf vni - show vrf <vrf-name> vni - show vrf all vni - show vrf <vrf-name> vni json - show vrf all vni json Before: ``` tor-1# show vrf vni VRF VNI VxLAN IF L3-SVI State Rmac default 100 None None Down None sym_1 8888 vxlan99 vlan490_l3 Up 44:38:39:ff:ff:25 sym_2 8889 vxlan99 vlan491_l3 Up 44:38:39:ff:ff:25 sym_3 8890 vxlan99 vlan492_l3 Up 44:38:39:ff:ff:25 sym_4 8891 vxlan99 vlan493_l3 Up 44:38:39:ff:ff:25 sym_5 8892 vxlan99 vlan494_l3 Up 44:38:39:ff:ff:25 tor-1# ``` After: ``` tor-1# show vrf default vni json { "vrfs":[ { "vrf":"default", "vni":100, "vxlanIntf":"None", "sviIntf":"None", "state":"Down", "routerMac":"None" } ] } tor-1# show vrf default vni VRF VNI VxLAN IF L3-SVI State Rmac default 100 None None Down None tor-1# tor-1# show vrf all vni VRF VNI VxLAN IF L3-SVI State Rmac default 100 None None Down None sym_1 8888 vxlan99 vlan490_l3 Up 44:38:39:ff:ff:25 sym_2 8889 vxlan99 vlan491_l3 Up 44:38:39:ff:ff:25 sym_3 8890 vxlan99 vlan492_l3 Up 44:38:39:ff:ff:25 sym_4 8891 vxlan99 vlan493_l3 Up 44:38:39:ff:ff:25 sym_5 8892 vxlan99 vlan494_l3 Up 44:38:39:ff:ff:25 tor-1# tor-1# tor-1# tor-1# tor-1# tor-1# show vrf all vni json { "vrfs":[ { "vrf":"default", "vni":100, "vxlanIntf":"None", "sviIntf":"None", "state":"Down", "routerMac":"None" }, { "vrf":"sym_1", "vni":8888, "vxlanIntf":"vxlan99", "sviIntf":"vlan490_l3", "state":"Up", "routerMac":"44:38:39:ff:ff:25" }, { "vrf":"sym_2", "vni":8889, "vxlanIntf":"vxlan99", "sviIntf":"vlan491_l3", "state":"Up", "routerMac":"44:38:39:ff:ff:25" }, { "vrf":"sym_3", "vni":8890, "vxlanIntf":"vxlan99", "sviIntf":"vlan492_l3", "state":"Up", "routerMac":"44:38:39:ff:ff:25" }, { "vrf":"sym_4", "vni":8891, "vxlanIntf":"vxlan99", "sviIntf":"vlan493_l3", "state":"Up", "routerMac":"44:38:39:ff:ff:25" }, { "vrf":"sym_5", "vni":8892, "vxlanIntf":"vxlan99", "sviIntf":"vlan494_l3", "state":"Up", "routerMac":"44:38:39:ff:ff:25" } ] } tor-1# ``` Ticket:#3260835 Issue:3260835 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan <sgopinathan@nvidia.com>
2023-01-11Merge pull request #12578 from Pdoijode/evpn-mac-vni-detDonatas Abraitis
zebra: Evpn mac vni detail show command
2023-01-03zebra: Evpn mac vni detail show commandPooja Jagadeesh Doijode
New show command "show evpn mac vni xx detail [json]" to display details of all the mac entries for the requested VNI. Output of show evpn mac vni xx detail json: { "numMacs":2, "macs":{ "ca:be:63:7c:81:05":{ "type":"local", "intf":"veth100", "ifindex":8, "uptime":"00:06:55", "localSequence":0, "remoteSequence":0, "detectionCount":0, "isDuplicate":false, "syncNeighCount":0, "neighbors":{ "active":[ "fe80::c8be:63ff:fe7c:8105" ], "inactive":[ ] } } } } Also added remoteEs field in the JSON output of "show evpn mac vni xx json". Output of show evpn mac vni xx json: "00:02:00:00:00:0d":{ "type":"remote", "remoteEs":"03:44:38:39:ff:ff:02:00:00:02", "localSequence":0, "remoteSequence":0, "detectionCount":0, "isDuplicate":false } Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-01-03zebra: fix a couple of typosMark Stapp
Fix a couple of typos in vty prompt and output text. Signed-off-by: Mark Stapp <mjs@labn.net>
2022-12-15Merge pull request #12513 from Pdoijode/masterDonatas Abraitis
zebra: JSON support for show nexthop-group rib
2022-12-14zebra: JSON support for show nexthop-group ribPooja Jagadeesh Doijode
Added JSON support for show nexthop-group rib command. JSON output: { "10":{ "type":"zebra", "refCount":3, "uptime":"00:00:46", "vrf":"default", "valid":true, "installed":true, "interfaceIndex":3, "nexthops":[ { "flags":3, "fib":true, "ip":"2001::2", "afi":"ipv6", "interfaceIndex":3, "interfaceName":"eth0", "vrf":"default", "active":true, "weight":1 } ] } } Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>