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-03-30vtysh, 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> (cherry picked from commit 0e2fc3d67f1d358896a764373f41cb59c095eda9)
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>
2022-12-12zebra: Add `zrouter.asic_notification_nexthop_control`Donald Sharp
Volta submitted notification changes for the dplane that had a special use case for their system. Volta is no more, the code is not being actively developed and from talking with ex-Volta employees there is no current plans to even maintain this code. Wrap the special handling of nexthops that their asic-dataplane did in a bit of code to isolate it and allow for future removal, as that I do not actually believe anyone else is using this code. Add a CPP_NOTICE several years into the future that will tell us to remove the code. If someone starts using it then they will have to notice this variable to set it and hopefully they will see my CPP_NOTICE to come talk to us. If this is being used then we can just remove this wrapper. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-28zebra: json support for show ip nhtSindhu Parvathi Gopinathan
show ip/ipv6 nht vrf <all | name> json support added. Commands enhanced with JSON: ---------------------------- show ip nht json show ip nht <addr> json show ipv6 nht json show ipv6 nht <addr> json show ip nht vrf <name> json show ip nht vrf all json show ipv6 nht vrf <name> json show ipv6 nht vrf all json show ip nht vrf default <addr> json show ipv6 nht vrf default <addr> json Sample JSON output: ------------------- tor-1# show ip nht vrf default json { "default":{ "nexthops":{ "27.0.0.5":{ "nhtConnected":false, "clientList":[ { "protocol":"bgp", "socket":70, "protocolFiltered":"none" } ], "gates":[ { "ip":"fe80::202:ff:fe00:2b", "interface":"uplink_1" }, { "ip":"fe80::202:ff:fe00:35", "interface":"uplink_2" } ], "resolvedProtocol":"bgp" }, "27.0.0.6":{ "nhtConnected":false, "clientList":[ { "protocol":"bgp", "socket":70, "protocolFiltered":"none" } ], "gates":[ { "ip":"fe80::202:ff:fe00:2b", "interface":"uplink_1" }, { "ip":"fe80::202:ff:fe00:35", "interface":"uplink_2" } ], "resolvedProtocol":"bgp" } } } } tor-1# show ipv6 nht vrf default json { "default": { "nexthops": { "fe80::202:ff:fe00:25": { "nhtConnected": true, "clientList": [ { "protocol": "bgp", "socket": 45, "protocolFiltered": "none" } ], "gates": [ { "interface": "swp1", "directlyConnected": true } ], "resolvedProtocol": "connected" }, "fe80::202:ff:fe00:2b": { "nhtConnected": true, "clientList": [ { "protocol": "bgp", "socket": 45, "protocolFiltered": "none" } ], "gates": [ { "interface": "swp1", "directlyConnected": true } ], "resolvedProtocol": "connected" } } } } tor-1# show ipv6 nht vrf all json { "default": { "nexthops": { "fe80::202:ff:fe00:25": { "nhtConnected": true, "clientList": [ { "protocol": "bgp", "socket": 45, "protocolFiltered": "none" } ], "gates": [ { "interface": "swp1", "directlyConnected": true } ], "resolvedProtocol": "connected" }, "fe80::202:ff:fe00:2b": { "nhtConnected": true, "clientList": [ { "protocol": "bgp", "socket": 45, "protocolFiltered": "none" } ], "gates": [ { "interface": "swp1", "directlyConnected": true } ], "resolvedProtocol": "connected" } } }, "mgmt": { "nexthops": {} }, "sym_1": { "nexthops": {} } } Ticket:#3229013 Issue:3229013 Testing Done: Unit test completed. Signed-off-by: Chirag Shah <chirag@nvidia.com> Signed-off-by: Sindhu Parvathi Gopinathan <sgopinathan@nvidia.com>
2022-11-17Merge pull request #12081 from sworleys/EMM-upstreamDonatas Abraitis
Rework of Various Handling in EVPN for Extended Mac Mobility
2022-11-07Merge pull request #12238 from donaldsharp/appendDonatas Abraitis
lib, zebra: Allow for zebra to recognize that a route has gotten desy…
2022-11-04lib, zebra: Add ability to encode/decode resilient nhg'sDonald Sharp
Add ability to read the nexthop group resilient linux kernel data as well as write it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-04lib, zebra: Allow for zebra to recognize that a route has gotten desyncedDonald Sharp
FRR does not use the NLM_F_APPEND semantics ( in fact I would argue that the NLM_F_APPEND semantics just introduce pain for all parties involved ) I would also argue that most people who use the kernel netlink api have recognized that NLM_F_APPEND for a route is a recipe for disaster that is well documented and as such it is not used as anything other than a curiousity by operators. See: https://bugzilla.redhat.com/show_bug.cgi?id=1337855 https://github.com/thom311/libnl/issues/226 Are 2 great examples of how confusing it is for anyone in user space to know what the correct thing to do is. Given that new fields can be added with no semantics to allow us to know what has resulted in a change or not. In an attempt to recognize this, let's note that FRR believes it has gotten out of sync with the kernel. Future commits will react to the desynchronized route and request from the kernel a reload of that specific route if possible. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-01zebra: use "get" naming for bgp accept lower knobStephen Worley
Use "get" as the name for checking the status of the bgp accept lower seq knob. This already has an equivalent "set" so makes sense to keep it consistent. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-07zebra: add knob to accept lower seq in evpnStephen Worley
Add a knob to accept lower seq number in evpn updates from BGP in Zebra. Note: Knob is enabled by default Signed-off-by: Stephen Worley <sworley@nvidia.com>