Commit Graph

467 Commits

Author SHA1 Message Date
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
Donald Sharp
d5ab760b34 zebra: Leave some warning breadcrumbs
When a user specifies static routes, there are a couple of states
where we will store the route and display it as part of the 'show run'
but it will not be installed until such time that the dependant state
is created.  Add some breadcrumbs to the user so that they can figure
out WTF just happened.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-17 14:04:47 -04:00
Renato Westphal
15da01e92d
Merge pull request #1973 from donaldsharp/static_nh_vrf
Static nh vrf
2018-04-10 17:27:57 -03:00
Russ White
bb04824d89
Merge pull request #2027 from qlyoung/fix-vrf-static-holdem-display
zebra: display holdem statics correctly
2018-04-06 13:21:49 -04:00
Quentin Young
cd4b15a523
zebra: display holdem statics correctly
Holdem statics display the dest (and mask, if present) string that the
user entered instead of converting to CIDR notation and applying the
mask. They need to do the latter.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-05 11:02:07 -04:00
Quentin Young
d7ca637481
zebra: consistently order static route attributes
Everyone else displays them with nexthop-vrf last.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-04 15:23:36 -04:00
Donald Sharp
4c66767c10 zebra: Prevent crash in the off-chance we make a mistake
Prevent zebra from crashing for when the nexthop vrf has
changed in some manner and the lookup fails.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-27 15:52:26 -04:00
Donald Sharp
90f86c0a4d zebra: Fixup enable/disable of static routes in vrfs
When a user enables and disables a vrf, we were not
properly cleaning up the static routes leaving us
in a state where we would crash by looking at anything
in zebra.

On disable of a vrf -> Search through all static routes
and if the nexthop vrf is the disabled vrf uninstall it.
Additionally uninstall all static routes in that zvrf

On enable of a vrf -> Search through all static routes
and if the nexthop vrf is the enabled vrf install it.
Additionally install all the static routes in that zvrf.

Ticket: CM-19768
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-27 15:52:25 -04:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t

Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:13:34 -04:00
Quentin Young
b88689f2a7
zebra: fix config of vrf static routes
This patch fixes two bugs with respect to static route configuration
inside vrf contexts:

* Entering a negative form of a static route created the static route.
* Once created, static routes could not be deleted.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-21 16:47:46 -04:00
Donald Sharp
6e94d41057 zebra: Fix comparison to not look at itself
The nexthop vrf comparison should not be against itself

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-20 19:16:24 -04:00
Donald Sharp
af5849b662 zebra: Fix memory leak on re-enter case
When we have a case where the user re-enters the same
ip route line, we need to delete the memory we just
malloc'ed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-20 18:41:00 -04:00
Quentin Young
be627102c0
zebra: fix static route config write
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-19 17:37:00 -04:00
Donald Sharp
6a17b1a0f2 zebra: Extend unknown vrf to vrf part of ip route
When specifying a ip route:

ip route 4.3.2.0/24 192.168.201.1 vrf DONNA

Accept DONNA even if it has not been created yet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-16 18:45:29 -04:00
Donald Sharp
ad97d1c10a zebra: Allow duplicate entry of a route
If a user enters a route inside a non kernel existant vrf:

vrf BLOOP
  ip route 4.3.2.0/24 192.168.201.1
!

They should be able to enter it over and over and over and
over and over no matter how futile it is.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-16 18:38:25 -04:00
Donald Sharp
e7f96f7411 zebra: Auto create the nexthop-vrf if needed.
Currently if I try to use a nexthop-vrf that has
not been specified yet we get a failure from the cli.

Add code to zebra so that if we fail to find the nexthop-vrf
we auto create it, instead of failing the install.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-16 18:36:10 -04:00
Renato Westphal
f22ab4c3fc
Merge pull request #1819 from donaldsharp/static_stuff
Static stuff
2018-03-14 11:26:20 -03:00
Donald Sharp
7ee30f288e lib: Isolate nexthop_group functions to nexthop_group.c
Also modify `struct route_entry` to use nexthop_groups.
Move ALL_NEXTHOPS loop to nexthop_group.h

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-09 11:07:41 -05:00
Donald Sharp
4060008bda zebra: Allow for storage of non-configed vrf routes
When zebra is being configed we allow for static routes
to be entered.  This presents a problem for when a vrf
is cli configed but not kernel configed yet.

Modify zebra to notice that when a static route is
entered and either the nexthop vrf or the vrf
is not fully configed, to save that config to the
side.

When vrf's become active( kernel configed ) parse
through the list of saved to the side static routes
and determine if any of them can be installed.

Additionally modify the cli to output the saved
to the side cli, so that we can properly handle
a wr mem.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-07 14:33:59 -05:00
Lou Berger
996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Philippe Guibert
81c9005ff6 zebra: enhance show vrf for netns and fixing
Show vrf command displays information on the vrf, if it is related to
vrf kernel or if it is related to netns.
When a vrf from kernel is detected, before creating a new vrf, a check
is done against an already present vrf, and if that vrf is not a vrf
mapped with a netns. If that is that case, then the creation is
rejected.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-02-27 11:11:24 +01:00
Philippe Guibert
ac3133a35d
Merge pull request #1736 from mkanjari/type5-with-asymm
zebra, bgp: Support type-5 routes with asymmetric routing
2018-02-27 10:36:57 +01:00
Donald Sharp
ae825b8bf0 zebra: Add code to display interesting tables
With the ability of zebra to handle random tables,
add code to display those tables via the
show <ip|ipv6> route table (1-...) [json] command.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-23 07:08:36 -05:00
Donald Sharp
6447dbb372 zebra: Clean up some SA issues found by new code
1) Add asserts in a couple of spots to show we
never expect prefix to be bad.
2) Fix some bfd code where out_ctxt will
always be NULL.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-13 23:41:31 -05:00
Mitesh Kanjariya
c48d9f5f85 zebra, bgp: Support type-5 routes with asymmetric routing
Asymmetric routing is an ideal choice when all VLANs are cfged on all leafs.
It simplifies the routing configuration and
eliminates potential need for advertising subnet routes.
However, we need to reach the Internet or global destinations
or to do subnet-based routing between PODs or DCs.
This requires EVPN type-5 routes but those routes require L3 VNI configuration.

This task is to support EVPN type-5 routes for prefix-based routing in
conjunction with asymmetric routing within the POD/DC.
It is done by providing an option to use the L3 VNI only for prefix routes,
so that type-2 routes (host routes) will only use the L2 VNI.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-10 00:41:28 -08:00
Renato Westphal
a97e5c1a80
Merge pull request #1722 from donaldsharp/vrf_mc_vrf
zebra: Fix vrf routes from assuming their nh's were in the default
2018-02-09 20:54:17 -02:00
Donald Sharp
70e98a7fe7 *: Make code use a consisten definition of labels
Turns out we had 3 different ways to define labels
all of them overlapping with the same meanings.
Consolidate to 1.  This one choosen is consistent
naming wise with what the *bsd and linux kernels
use.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08 20:31:37 -05:00
Donald Sharp
4a7371e9e2 *: Track vrfs per nexthop not per route entry
Track the vfrs on a per nexthop basis instead
of on a per route entry basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-08 19:35:53 -05:00
Philippe Guibert
8e71b98f72
Merge pull request #1654 from mkanjari/evpn-symm-routing-enhancements
Evpn symmetric routing enhancements
2018-02-08 11:46:29 +01:00
Donald Sharp
dfce9b257d zebra: Fix vrf routes from assuming their nh's were in the default
Fix the read in of vrf routes on a start or restart that caused
the nexthop_vrf to be assumed to be the default vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-07 18:22:15 -05:00
Donald Sharp
2481e73221 zebra: Fix v6 nexthop-vrf and nexthop confusion
The v6 code had the same issue with how it handled
nexthop-vrf and nexthop when it was entered on the
same line.  This fixes that issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-30 00:15:45 -05:00
Donald Sharp
e65dfe7e56 zebra: Cleanup error handling of nexthop vrf and vrf
The error handling of the nexthop vrf and the vrf
for what was specified on the cli was not as clean
as it should have been.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-29 15:18:28 -05:00
Donald Sharp
e6149ab4b8 zebra: Fix to get correct nexthop-vrf
The nexthop_vrf should be looked up as appropriate,
If the nexthop_vrf was specified use that, else
use the vrf context of what was passed in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-27 05:28:51 -05:00
vivek
22bd3e9497 *: Refine the notion of a configured VRF in FRR
Refine the notion of what FRR considers as "configured" VRF. It is no longer
based on user just typing "vrf FOO" but when something is actually configured
against that VRF. Right now, in zebra, the only configuration against a VRF
are static IP routes and EVPN L3 VNI. Whenever a configuration is removed,
check and clear the "configured" flag if there is no other configuration for
this VRF. When user attempts to configure a static route and the VRF doesn't
exist, a VRF is created; the VRF is only active when also defined in the
kernel.

Updates: 8b73ea7bd479030418ca06eef59d0648d913b620
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Don Slice <dslice@cumulusnetworks.com>

Ticket: CM-10139, CM-18553
Reviewed By: CCR-7019
Testing Done:
1. Manual testing for L3 VNI and static routes - FRR restart, networking
restart etc.
2. 'vrf' smoke

<DETAILED DESCRIPTION (REPLACE)>
2018-01-23 18:49:40 -08:00
mitesh
317f1fe02f zebra/bgpd: fix compilation issues
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 16:30:40 -08:00
Mitesh Kanjariya
4cce389e0e bgpd/zebra: show command enhancements for EVPN symmetric routing
0. move all global EVPN details to 'show evpn [json]' command
1. change "VRF" to "Tenant VRF" in 'show evpn vni'
2. change 'show vrf vni' command to tabular form
   and add l3-vni related params to the output
3. show evpn rmac should show refcount only in detailed output
4. show evpn next-hop should show refcount only in detailed output
5. move VRF in 'show evpn l3vni' to the end
6. add num rmacs and num nexthops to show evpn l3vni
7. remove "info" from 'show bgp vrf <> l3vni info'
8. show evpn vni <vni> should show l2vni details or l3 vni details
9. show evpn vni should show both L2 and L3 VNIs
10. show bgp l2vpn evpn - shows all global bgp l2vpn evpn details
11. show bgp l2vpn evpn vni - will show both l2 and l3 vnis
12. show bgp l2vpn evpn vni - should show both l2 and l3 vnis
13. follow camel notation for all json keys

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -08:00
Mitesh Kanjariya
e8d26197fa bgpd: vrf/vni mapping command for default instance
Ticket: CM-18906
Review: CCR-6946
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -08:00
Philippe Guibert
d6fed38109
Merge pull request #1618 from donaldsharp/zebra_startup_ordering
zebra route-leaking for static routes
2018-01-23 08:25:01 +01:00
Philippe Guibert
90ac32c209 zebra: replace 0 value on zebra with VRF_DEFAULT
On some places of code, the VRF_DEFAULT define was not used. This commit
is ensuring that the macros is well used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-01-22 14:58:02 +01:00
Donald Sharp
61408536df zebra: Add ability for default vrf to route-leak
Allow the end user to specify static routes that leak
across vrf's in the default vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:26:42 -05:00
Donald Sharp
37728041b6 zebra: Move ip route ... generation to vrf control
Move the code that generates the 'show run' output for
'ip route' to be controlled by the vrf config generation
code.  Since it really belongs there.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:26:41 -05:00
Donald Sharp
b2ffa06b4f zebra: Add vrf level 'ip route ...' commands
Add the ability to accept 'ip route ...' commands
from within a vrf context.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:25:07 -05:00
Donald Sharp
cbb0dbf6bd zebra: Add the zvrf pointer to the 'struct static_route'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:22:46 -05:00
Donald Sharp
2f03bc8f72 zebra: Add zebra_static_route_leak function
Add a function to handle the route leaking of a static
route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:22:46 -05:00
Donald Sharp
2793a0980d zebra: When displaying nexthop information show correct vrf
If the vrf for the nexthop is different than the vrf the
route is in, display the nexthops vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:20:36 -05:00
Donald Sharp
99b9d9609f zebra: Use the correct vrf id to lookup the ifp pointer
Use the nexthop vrf_id to properly lookup the ifp pointer
for display purposes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-12 09:20:36 -05:00
Mitesh Kanjariya
9bb77a5b3d
Merge branch 'master' into evpn-symmetric-routing 2018-01-11 09:00:23 -08:00
Renato Westphal
fb6f7c2c25
Merge pull request #1515 from donaldsharp/selected_to_front1
Store selected_fib as a pointer off of rib_dest_t
2017-12-19 14:09:03 -02:00
mitesh
0412988bd5 zebra: only show vrf matched to a l3-vni in show vrf vni
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
mitesh
3f02fbab67 zebra: pass ERR_STR_SZ in zebra_vxlan_process_vrf_vni_cmd
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
Mitesh Kanjariya
90384b2471 zebra: vrf to vni mapping command is only valid under vrf submode
Ticket: CM-18821
Review: Trivial
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
316f4ca4d9 zebra: json support for show evpn rmac specific mac command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
c0e519d32d zebra: json support for show evpn specific next-hop command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
35be5542dd zebra: json support for show vrf vni command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
9aa741eae8 zebra: show commands for specific rmac/nh entries
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
b7cfce934f zebra, lib: zebra changes for symmetric routing support
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:56:44 -08:00
Donald Sharp
0efb5e9b4b zebra: Display if a taged route is being used as a realm
When displaying a specific route and if it has a tag
and if we have turned on realm support notify the user
that a tag value of (1-255) is installed into the kernel
with the realm set.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-14 09:49:43 -05:00
Donald Sharp
c0d136aec2 zebra: Try to move non zapi cli commands from zserv.c
zserv.c has become a bit of a dumping ground for zebra cli.
I'd like to focus the zserv.c code into it's core functionality
which is handling the zapi interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-13 07:57:15 -05:00
Donald Sharp
5f7a4718e2 zebra: Replace SELECTED_FIB flag with a rib_dest_t pointer
The SELECTED_FIB flag was placed upon the entry that we
have inserted into the kernel.  Remove this flag and replace
with a `rib_dest_t` *selected_fib.  Just keep track of the
selected_fib as we modify it.  This removes allot of
FOREACH_RE loops as that we do not need to find the
entry anymore.

At this point in time I think this is a very minor performance
boost.  Most `rib_dest_t` structures do not typically carry
more than 1 route_entry, but the minute you start having more
than one entry you can and will start having significant processing
time spent finding the selected_fib.

A future commit may re-order the route entries and possibly
keep more pointers on `rib_dest_t` to avoid lookup.  This
is a bit tricky because of the FIB_OVERRIDE code.

Signed-off-by Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-05 17:26:32 -05:00
Quentin Young
10c61d28bf
zebra: add back support for nUlL0
Re-add support for typos when specifying a null route.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-28 14:12:07 -05:00
Renato Westphal
88aa65f849
Merge pull request #1470 from donaldsharp/zebra_multicast
Zebra multicast
2017-11-21 12:50:46 -02:00
Donald Sharp
fba31af2b5 zebra: Fix 'show ip rpf' to actually work
Rework of do_show_ip_route caused the 'show ip rpf'
cli to stop working.  This put's it back into working
order.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-19 19:47:32 -05:00
Donald Sharp
ab59f4f7e3 ldpd, zebra: Fix make dist compiles
The original clippy implementation used if VTYSH_EXTRACT_PL
was defined or not to know to include as part of the creation
of vtysh.

Follow their lead here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-09 11:14:33 -05:00
Russ White
453a5340a8
Merge pull request #1363 from donaldsharp/z_improvements
Z improvements
2017-10-31 20:27:19 -04:00
Renato Westphal
5ce91022c1 zebra: unify the ipv4/ipv6 'show ip route' commands - part 2/2
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-25 16:03:56 -02:00
Donald Sharp
62d52dedf0 zebra: Add Hidden 'zebra zapi-packets (1-10000)' command
Allow the end user to specify how many packets we want
to process at one time coming down the zapi, before
we yield and let other things process.

This is a Hidden command because it is not necessarily
something that we want end users to be able to play with

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-25 11:13:42 -04:00
Donald Sharp
3a30f50f3f zebra: Allow user to specify work-queue processing hold time
Allow the user to modify the work-queue processing hold time
from 10ms to a value from (0-10000).  Make the command hidden
as that it's a semi-dangerous command and it could cause
issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-25 10:59:05 -04:00
Renato Westphal
ce0ff16bd9 zebra: fix route node leak on error path
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 10:23:33 -02:00
Renato Westphal
a3e13ef37f zebra: 'show ip route' with multiple options at the same time
Now it's possible to specify multiple options when viewing the RIB or
FIB.

Example: 'show ip route 192.168.0.0/16 longer-prefixes tag 10 ospf'

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 10:23:33 -02:00
Renato Westphal
ecffa493c0 zebra: unify the ipv4/ipv6 'show ip route' commands - part 1/2
Note: I had to remove one assert in clidef.py in order to fix a build
error when using a preprocessor string (FRR_IP_REDIST_STR_ZEBRA) inside
a DEFPY command. This should be revisited later.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 10:12:40 -02:00
Renato Westphal
8526b84200 zebra: fix display of negative route metrics and tags
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-05 22:55:58 -03:00
Renato Westphal
67c0a9206c Merge pull request #1180 from dwalton76/ipv6-static-route-null0
Ipv6 static route null0
2017-09-27 13:42:53 -03:00
Daniel Walton
1e058f38c2 zebra: split ip route DEFUNs for blackhole, reject, etc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-09-27 15:35:28 +00:00
Daniel Walton
d7d75634e9 zebra: cleanup reject vs blackhole vs null0 vs Null0
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-09-20 22:24:27 +04:00
Renato Westphal
a2addae8fe *: use clang's 'ForEachMacros' format style option
This fixes the broken indentation of several foreach loops throughout
the code.

From clang's documentation[1]:
  ForEachMacros: A vector of macros that should be interpreted as foreach
  loops instead of as function calls.

[1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-15 14:53:46 -03:00
Daniel Walton
bb92922eaa zebra: cleanup reject vs blackhole vs null0 vs Null0
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-09-14 18:11:29 +00:00
Donald Sharp
14a481d916 zebra: Allow 'show ip route...' to display uptime for all routes
Display uptime for all route types instead of just for RIP,
OSPFv2, ISIS, NHRP, TABLE? and BGP routes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-12 14:58:10 -04:00
Donald Sharp
eaf5150f58 zebra: Modify 'show ip route ...' to show duplicated nexthops
Add the ability for person issuing 'show ip route...' commands
to see if we've suppressed adding a nexthop to the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-12 14:52:20 -04:00
Renato Westphal
57a58d777f zebra: accept Null0 again in addition to null0
Restore behavior before commit a830942.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-05 11:50:34 -03:00
Renato Westphal
9aabb2ea74 zebra: display static blackhole routes consistently
If we configure a static route pointing to null0 and zebra displays
it with the 'blackhole' keyword in the running configuration, the
frr-reload.py script will have issues. Fix this by introducing the
'static_blackhole_type' enum.

Fixes #1091.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-05 11:50:34 -03:00
Renato Westphal
cc54cfee3a zebra: remove refcnt from the route_entry structure
This reference counter was introduced in 2001, apparently to solve a
problem with connected routes being added/removed multiple times. The RIB
code changed a lot since then, and giving the current callers of rib_add()
and rib_delete() it's safe to assume that we don't need this anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-31 21:17:11 -03:00
Renato Westphal
b3c18264e4 Merge pull request #1079 from qlyoung/fix-style-a
*: fix style
2017-08-31 13:22:55 -03:00
Jafar Al-Gharaibeh
959768e8d0 Merge pull request #1044 from donaldsharp/combination
Coverity Cleanup of Stuff
2017-08-31 10:25:55 -05:00
Quentin Young
60466a63f2
*: fix style
Fixes style nits introduced by recent pull requests.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-30 11:27:11 -04:00
David Lamparter
a830942228 zebra: cleanup blackhole support
blackhole support was horribly broken. cleanup by removing blackhole
stuff from ZEBRA_FLAG_*

introduces support for "prohibit" routes (Linux/netlink only)
also clean up blackhole options on "ip route" vty commands.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-28 05:07:51 +02:00
Renato Westphal
0af35d90a1 *: fix assorted issues detected by Coverity Scan
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-24 21:49:39 -03:00
Renato Westphal
b81ef7b30a zebra: fix display of static routes pointing to nonexistent interfaces
Bug introduced a couple of weeks ago by myself. Only happens when the
route has an IP nexthop + a nexthop interface.

Example:
debian(config)# ip route 10.0.1.0/24 172.16.1.10 fake1
debian(config)# do sh run
Building configuration...
[snip]
!
ip route 10.0.1.0/24 172.16.1.10 unknown
!
end

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-22 10:52:07 -03:00
David Lamparter
695bb8f0d1 Merge branch 'frr/pull/822' ("EVPN fixes")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-09 21:34:10 +02:00
Donald Sharp
d3d9c86f54 Merge pull request #919 from opensourcerouting/static-routes-ifindex-update
fixup static routes' ifindexes when interfaces (dis)appear
2017-08-08 13:39:19 -04:00
Donald Sharp
bd592158ef zebra: Use JSON_STR
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-08 10:30:13 -04:00
Chirag Shah
cd23307906 zebra: Enable JSON for EVPN show cmds
Ticket: CM-16959
Reviewed By: CCR-6401
Testing Done:
Execute 'show evpn .... json' form of outputs with local/remote vteps

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-08-08 10:28:50 -04:00
Donald Sharp
99a6a31e50 *: Define the number of seconds in a Day, Week and year
The defines:

ONE_DAY_SECOND
ONE_WEEK_SECOND
ONE_YEAR_SECOND

were being defined all over the system, move the
define to a central location.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-08 09:06:22 -04:00
David Lamparter
c3c0406378 zebra: static: update on ifindex changes
Whenever an interface is created or deleted in the system, we need to
check whether we have static routes referencing that interface by name.
If so, we need to [un]install these routes.

This has the unfortunate side effect of making static routes with
non-existent interfaces disappear from "show ip route", but I think
that's acceptable (and I don't see a "good" fix for that).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-06 05:17:09 +02:00
David Lamparter
23443030d3 zebra: static: rename IFINDEX -> IFNAME
Static routes are really held by ifname, not ifindex.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-06 05:17:09 +02:00
Jorge Boncompte
925c2f8853 zebra: do not hide distance and metric for kernel routes
There's no reason for not showing this information.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
2017-08-04 10:19:36 +02:00
Jorge Boncompte
1994ae60ee zebra: show nexthop MTU if available on detailed 'show ip route'
Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
2017-08-04 10:19:36 +02:00
Renato Westphal
00685a85e2 zebra: use DEFPY for static routes
Now we have a single command for IPv4 static routes and another one for
IPv6 static routes (+ one command for IPv4 multicast static routes).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-28 00:46:59 -03:00
Renato Westphal
1d3f0eff59 zebra: unify the ipv4/ipv6 static route functions
Addresses Issue #655.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 23:46:56 -03:00
Renato Westphal
599186ad97 zebra: allow fully specified static ipv4 routes
Fully specified routes are useful when you need to ensure that the
nexthop address is reachable through the specified interface.

Addresses Issue #641.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 23:46:41 -03:00
Renato Westphal
c6cef20ba9 zebra: refactor zebra_static_ipv4() and static_ipv6_func()
This is a preliminary step to join both functions into one later.

The main idea here is to make these functions have separate arguments
for the nexthop address and the nexthop interface, and adjust the call
sites appropriately. Having an argument that could be a nexthop address
OR a nexthop interface was making the code very hard to follow. With
this simplification, a lot of code duplication was removed and now both
functions look very similar.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 23:39:35 -03:00
Renato Westphal
33df4bb219 zebra: accept static v6 routes with non-existent nexthop interfaces
We don't need to enforce that the interface exists because the route can
be activated later once the interface becomes available. We already do
this for IPv4 routes and IPv6 routes with both a nexthop address and a
nexthop interface.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 23:39:27 -03:00
Renato Westphal
d97c792e9f zebra: remove redundant DEFUNs for labeled static routes
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 21:47:23 -03:00
Renato Westphal
8bcbf3b0d7 zebra: remove weird blackhole/reject ipv6 static routes
This is the v6 counterpart of commit 74d263466b.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 21:45:01 -03:00
Renato Westphal
2f8aa457e0 zebra: use curly braces for optional arguments of static routes
This way the optional arguments can be provided in any order.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-27 21:44:34 -03:00
Daniel Walton
1ac79ce8df zebra: static route cleanup
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

- The 'reject' keyword was being lost
- Hide the "ip route A.B.C.D A.B.C.D" config options since these will be
  displayed as "ip route A.B.C.D/X"
2017-07-25 13:24:45 -07:00
David Lamparter
9d303b37d7 Revert "*: reindent pt. 2"
This reverts commit c14777c6bf.

clang 5 is not widely available enough for people to indent with.  This
is particularly problematic when rebasing/adjusting branches.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-22 14:52:33 +02:00
whitespace / reindent
c14777c6bf
*: reindent pt. 2
w/ clang 5

* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
2017-07-17 15:26:02 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
Donald Sharp
2850f0ea58 bgpd, zebra: Cleanup warnings from new code
1) Clean up VTY_NEWLINE -> \n
2) Remove usages of VTY_GET_INTEGER

Signed-off-by: Donald Sharp
2017-07-14 08:52:45 -04:00