Commit Graph

375 Commits

Author SHA1 Message Date
Donald Sharp
ac5aa23f93 zebra: Add a dump table information command to zebra
Allow zebra to dump the table information it has from a router perspective.

This table looks like this:
donna.cumulusnetworks.com# show zebra router table summary
VRF             NS ID    VRF ID     AFI            SAFI    Table      Count
---------------------------------------------------------------------------
default             0         0    IPv4         unicast       49          1
default             0         0    IPv4         unicast      254          7
default             0         0    IPv4       multicast      254          9
default             0         0    IPv6         unicast      254          1
default             0         0    IPv6       multicast      254          1
BLUE                0        31    IPv4         unicast     1005          0
BLUE                0        31    IPv4       multicast     1005          0
BLUE                0        31    IPv6         unicast     1005          0
BLUE                0        31    IPv6       multicast     1005          0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 09:48:40 -05:00
Philippe Guibert
b85c827591 zebra: add command show ip/ipv6 import-check table
Add the ability to dump import check nexthop table.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-12-17 12:19:28 +01:00
Donald Sharp
9e7cd6fdca zebra: show ip route A.B.C.D json would only show last route entry
The `show ip route A.B.C.D json` command was only displaying
the last route entry looked at and we would drop the data
associated with other route entries.  This fixes the issue:

robot# 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

K>* 0.0.0.0/0 [0/100] via 192.168.201.1, enp3s0, 00:13:31
C>* 4.50.50.50/32 is directly connected, lo, 00:13:31
D   10.0.0.1/32 [150/0] via 192.168.201.1, enp3s0, 00:09:46
S>* 10.0.0.1/32 [1/0] via 192.168.201.1, enp3s0, 00:10:04
C>* 192.168.201.0/24 is directly connected, enp3s0, 00:13:31
robot# show ip route 10.0.0.1 json
{
  "10.0.0.1\/32":[
    {
      "prefix":"10.0.0.1\/32",
      "protocol":"sharp",
      "distance":150,
      "metric":0,
      "internalStatus":0,
      "internalFlags":1,
      "uptime":"00:09:50",
      "nexthops":[
        {
          "flags":1,
          "ip":"192.168.201.1",
          "afi":"ipv4",
          "interfaceIndex":2,
          "interfaceName":"enp3s0",
          "active":true
        }
      ]
    },
    {
      "prefix":"10.0.0.1\/32",
      "protocol":"static",
      "selected":true,
      "distance":1,
      "metric":0,
      "internalStatus":0,
      "internalFlags":2064,
      "uptime":"00:10:08",
      "nexthops":[
        {
          "flags":3,
          "fib":true,
          "ip":"192.168.201.1",
          "afi":"ipv4",
          "interfaceIndex":2,
          "interfaceName":"enp3s0",
          "active":true
        }
      ]
    }
  ]
}
robot#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-05 15:12:50 -05:00
Sri Mohana Singamsetty
ad31e8d398
Merge pull request #3372 from nitinsoniism/show_evpn_mac_vni_all_detail
zebra: Add "show evpn mac vni all detail" command
2018-12-04 10:19:18 -08:00
David Lamparter
21e2819dbf
Merge pull request #3340 from nitinsoniism/show_evpn_vni_detail
zebra: Add "show evpn vni detail" command
2018-12-04 17:29:50 +01:00
Chirag Shah
1883de666f zebra: dup addr detect clear cmd non-zero return
Clear dup address vni needs to return non-zero value
in case of command is not successful.

Ticket:CM-23122
Testing Done:
run clear command and check upon failure return code is non-zero.

root@TORS1:~# vtysh -c "clear evpn dup-addr vni 1000 ip 45.0.1.26"
% Requested IP's associated MAC 00:01:02:03:04:05 is still in duplicate
% state
root@TORS1:~# echo $?
1

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-12-03 16:56:00 -08:00
Nitin Soni
e3fac9195d zebra: Add "show evpn arp-cache vni all detail" command
Change helps display detailed output for all possible VNI neighbors
without specifying VNI and ip. It helps in troubleshooting as a single
command can be fired to capture detailed info on all VNIs.

Ticket: CM-22832
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8034
2018-11-27 05:56:56 -08:00
Nitin Soni
cffe7580fd zebra: Add "show evpn mac vni all detail" command
Change helps display detailed output for all possible VNI MACs without
specifying VNI or mac. It helps in troubleshooting - a single
command can be fired to capture detailed info on all VNIs.
Also fixed and existing json related bug where json object is created by
a parent function and freed in child function.

Ticket: CM-22832
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8028
2018-11-27 05:44:48 -08:00
Nitin Soni
09af6961d4 zebra: Add "show evpn vni detail" command
Change helps display detailed output for all possible VNIs without
specifying VNI. It helps in troubleshooting - a single command can
be fired to capture detailed info on all VNIs.

Ticket: CM-22831
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8013
2018-11-21 08:13:01 -08:00
Chirag Shah
09de9258a9 zebra: dup addr detect clear command
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Chirag Shah
1374d4dbc2 zebra: dup addr detect operation commands
Display duplicate detected list of MACs and VNIs.
- Per VNI
- Across all VNIs

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-11-17 19:22:17 -08:00
Russ White
2379dbecbd
Merge pull request #3202 from donaldsharp/evpn_dump
Evpn dump
2018-11-08 18:13:27 -05:00
Russ White
7c32c1dc10
Merge pull request #3255 from dslicenc/show_evpn_mac_json
zebra: add json support to show evpn mac vni <num> mac <mac>
2018-10-31 21:47:18 -04:00
Donald Sharp
093e3f23f6 bgpd, lib, vtysh, zebra: Convert to using CMD_VNI_RANGE
For the vni range use a macro to keep track of it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-31 06:23:32 -04:00
Don Slice
24cdbd0d8b zebra: add json support to show evpn mac vni <num> mac <mac>
Added the json output capability in order to improve troubleshooting
capabilities.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-10-29 13:09:31 +00:00
Donald Sharp
69c19e1def
Merge pull request #2946 from mjstapp/dplane_2
Zebra: async dataplane, phase 1
2018-10-28 16:10:45 -04:00
David Lamparter
00b7a9ddfe
Merge pull request #2926 from donaldsharp/router
zebra_ns split up
2018-10-26 22:24:15 +02:00
David Lamparter
0437e10517 *: spelchek
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-25 20:10:57 +02:00
Mark Stapp
91f1681258 zebra: limit queued route updates
Impose a configurable limit on the number of route updates
that can be queued towards the dataplane subsystem.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25 08:57:04 -04:00
Mark Stapp
1d11b21f33 zebra: add dplane show commands
Add first pass at show commands for the zebra dplane. Add some stats
counters to show. Start prep for correct shutdown processing, and for
multiple providers.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-10-25 08:57:04 -04:00
Donald Sharp
89272910f7 zebra: Start breakup of zns into zrouter and zns
The `struct zebra_ns` data structure is being used
for both router information as well as support for
the vrf backend( as appropriate ).  This is a confusing
state.  Start the movement of `struct zebra_ns` into
2 things `struct zebra_router` and `struct zebra_ns`.

In this new regime `struct zebra_router` is purely
for handling data about the router.  It has no knowledge
of the underlying representation of the Data Plane.

`struct zebra_ns` becomes a linux specific bit of code
that allows us to handle the vrf backend and is allowed
to have knowledge about underlying data plane constructs.

When someone implements a *bsd backend the zebra_vrf data
structure will need to be abstracted to take advantage of this
instead of relying on zebra_ns.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-24 06:52:07 -04:00
vishaldhingra
7cf16e19c5 zebra: vrf aware routmap is missing in Zebra #2802(Part 4 of 4)
The new cli for show output

Signed-off-by: vishaldhingra vdhingra@vmware.com
2018-10-11 10:49:34 -07:00
vishaldhingra
214e5c2679 zebra: vrf aware routmap is missing in Zebra #2802(Part 3 of 4)
The cli changes to allow this to work.

Signed-off-by: vishaldhingra vdhingra@vmware.com
2018-10-11 10:48:23 -07:00
vishaldhingra
6d53d7b1af zebra: vrf aware routmap is missing in Zebra #2802(Part 2 of 4)
Function parameter replacement of using zvrf instead of vrf_id

Signed-off-by: vishaldhingra vdhingra@vmware.com
2018-10-11 10:46:55 -07:00
Donald Sharp
6ca30e9ec6 bgpd, lib, zebra: Wrapper get/set of table->info pointer
Wrapper the get/set of the table->info pointer so that
people are not directly accessing this data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-23 20:04:39 -04:00
Don Slice
9f049418bc bgpd/ospfd: make bgp and ospf json response a bit more consistent
Problem reported that some bgp and ospf json commands did not return
any json output at all if the bgp/ospf instance did not exist.
Additionally, some bgp and ospf json commands did not return any json
output if the instance existed but no neighbors were defined.  This
fix makes these commands more consistent in returning empty braces for
json output and issue a message if not using json output.  Additionally,
made the flag "use_json" a bool to make it consistent since previously,
it had been defined as an int, char, u_char, and bool at various places.

Ticket: CM-21040
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-30 12:40:18 +00:00
David Lamparter
6de00b4e95
Merge pull request #2799 from adharkar/frr-zebra_cli
Zebra: Changes to "show ip route" json commands
2018-08-08 20:27:49 +02:00
Ameya Dharkar
96d71e3878 1. Added json output to "show ip route <prefix>" command
2. Added tag O/P to "show ip route json" command

Signed-off-by: Ameya Dharkar adharkar@vmware.com
2018-08-07 15:15:34 -07:00
Donald Sharp
9f2982ab69 zebra: Remove zebra_static.c and .h
These are no longer needed so remove.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-29 12:37:26 -04:00
Donald Sharp
7e24fdf333 staticd: Start the addition of a staticd
This is the start of separating out the static
handling code from zebra -> staticd.  This will
help simplify the zebra code and isolate static
route handling to it's own code base.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-29 12:37:24 -04:00
Lou Berger
bf7bf2b99c
Merge pull request #2719 from pguibert6WIND/fix_tableno_vrf
zebra: fix missing table identifier passed for ip route vrf commands
2018-07-28 10:42:07 -04:00
Nathan Van Gheem
ec1db5882d lib,zebra: fix json output when vrf1 when not active
When I did a show ip route with `json` on a vrf when it didn't exist,
frr would output invalid json.

Signed-off-by: Nathan Van Gheem <nathan@cumulusnetworks.com>
2018-07-27 10:17:03 -04:00
Philippe Guibert
521191140d zebra: fix missing table identifier passed for ip route vrf commands
The parameter was missing in that vty command. Then it is being added.
Also some documentation is refreshed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-27 08:42:14 +02:00
Philippe Guibert
7929821a81 zebra: show pbr iptable per iptable
Add ability to pass a ip table parameter.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-24 12:17:57 +02:00
Renato Westphal
f4f9200dec
Merge pull request #2668 from dslicenc/cm21722-v6-vrf-display
zebra: remove default vrf output for kernel vrf ipv6 blackhole default
2018-07-23 14:56:29 -03:00
Christian Franke
c9591045cc zebra: fix do_show_route_helper to include srcdest routes 2018-07-19 15:16:57 -04:00
Don Slice
bbde7a0f25 zebra: fix nexthop type check for kernel default route display
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-07-18 13:05:50 +00:00
Don Slice
fc132690b4 zebra: remove default vrf output for kernel vrf ipv6 blackhole default
It was reported that "show ipv6 route vrf <vrfname>", "show ipv6 route
vrf <vrfname> ::/0 " or "show ipv6 route vrf <vrfname> json" all
displayed that the nexthop was in the default vrf.  This was because
the kernel netlink messages would supply the RTA_OIF of the loopback
interface for the kernel-created default route for the vrf, where ipv4
did not supply any RTA_OIF.  This fix suppresses the display if the
nexthop and route entry are in different vrfs and the nexthop is
NEXTHOP_TYPE_BLACKHOLE.

Ticket: CM-21722
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-07-17 14:35:33 +00:00
Chirag Shah
62710e2b33 zebra: Hide default vrf instance of l3vni cmd
Hide following l3vni config from DEFAULT_VRF instance
until it is fully supported.

TORS1(config)# vni 2222456 prefix-routes-only

Ticket:CM-20572

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-06-15 15:42:20 -07:00
paco
77e03f0511 zebra: resource leak fix (Coverity 1465679)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-08 18:51:43 +02:00
Russ White
49eeb60a70
Merge pull request #2123 from qlyoung/zserv-mt
Multithreaded Zserv
2018-06-08 06:47:14 -04:00
Philippe Guibert
00384b5fbd zebra: keep one command to handle vty with/without table param
That fix is a workaround from a vtysh limitation.
Because table identifier should be accessible in configuration only for
vrf netns backends, there was a need to differentiate the vty commands.
Unfortunately, vtysh parses the two commands without knowing which
command has really been installed.
Using one single vty command will avoid having this issue in vtysh.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
b73823efa1 zebra: add in show vrf information about vrf backend kind
By default, nothing is displayed. If vrf backend is linux network
namespaces, then "netns-based vrfs" is displayed, before dumping the
list of VRFs.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
87d6ac7a04 zebra: add show ip route table vrf command
It is possible to get table per VRF, provided that vrf backend is
configured with NETNS.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
e9748a8901 zebra: table_id election with the vrf backend
As table_id for VRF with netns backend is main table ( RT_TABLE_MAIN or
zebrad.rtm_table_default), this makes possible to return the table id
that wants to be configured for those cases. ( in addition to default
VRF). In other cases ( VRF Lite presumably), then vrf table_id is
returned.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Philippe Guibert
b3b086026b zebra: add table keyword to route configuration vty command
Add the table keyword for all ip route/ip mroute/ipv6 route commands
that are available. Also, the main structure is being added a table
identifier.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-06-01 15:24:13 +02:00
Quentin Young
ccd51bd210 zebra: misc fixes, perf improvements
* Coalesce multiple write() syscalls into one
* Write larger chunks
* Decrease default read limit to 1000
* Remove unnecessary operations from hot loop (zserv_write)
* Move cross-schedule out of obuf lock
* Use atomic ops to update atomic variable

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-29 19:06:16 +00:00
Philippe Guibert
586f4ccf2c zebra: pbr vty show command for ipset and iptables
Two new vty show functions available:
show pbr ipset <NAME>
show pbr iptables <NAME>

Those function dump the underlying "kernel" contexts. It relies on the
zebra pbr contexts. This helps then to know which zebra pbr
context has been configured since those contexts are mainly configured
by BGP Flowspec.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-05-25 15:49:38 +02:00
Mitesh Kanjariya
cf29971433 zebra: vni [prefix-routes-only] should also be provided for the 'no' cmd
We have a command to enable symmetric routing only for type-5 routes.
This command is provided under vrf <> option in zebra as follows:
vrf <VRF>
  vni <VNI> [prefix-routes-only]
We need the corresponding no version of the command as well as follows:
vrf <VRF>
  no vni <VNI> [prefix-routes-only]

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Donald Sharp
f03098f979 zebra: Add a few more breadcrumbs
re->status and re->flags both influence our decision states
for rib processing.  Yet it's impossible to see them.  Add
a tiny bit of code to allow us to look at them when things
are not behaving like we would expect.

Additionally dump the nexthop->flags at the same time for
the same reasons.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-02 16:50:37 -04:00