Commit graph

37 commits

Author SHA1 Message Date
Sougata Barik 86b294698f zebra: Fix ip protocol route-map issue.
"ip/ipv6 protocol any route-map <route map>" cli is setting
wrong route type ( ZEBRA_ROUTE_MAX ), It should set route type
ZEBRA_ROUTE_ALL.

Ticket: #4101560

Signed-off-by: Sougata Barik <sougatab@nvidia.com>
2025-01-06 17:02:21 +05:30
Donald Sharp d4aa24ba7d *: Introduce Local Host Routes to FRR
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-11-01 17:13:06 -04:00
Philippe Guibert 07a459ac25 lib: add support for new redistribute table-direct element
Add a new kind of redistributed route that helps to import entries
that are not copied in the default routing table. Contrary to the
'redistribute table' feature, the entries are directly obtained from
the zebra appropriate routing table.

The 'table-direct' naming expresses the direct redistribution of
the routes, without having to copy the route entries in the default
routing table.

The distance value for this route is 14. Such route entries will
be prioritary compared to 'table' and 'ebgp' route entries type.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-20 13:28:52 +02:00
Donald Sharp 8afb9d8a70 *: Fix spelling of seperator
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19 08:15:23 -04:00
Mark Stapp 0a0875df5b lib: remove quagga from route_types.txt
Remove the q-word.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-07-19 08:43:48 -04:00
Igor Ryzhov b3b4dfa5ae lib: respect --disable-daemon flags in route_types.h
* remove pre-generation of route_types.h from configure

  This change is a partial revert of commit 306ed6816. This is a little
  drawback, but at least "make lib/libfrr.la", mentioned in the commit,
  still works because route_types.h is forced to be built in f1b32b2e5.

* add "enabled" field to route_types.txt to track which daemon should
  be enabled to add the routing protocol to "show ip route" header and
  to redistribution list

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 12:59:46 +03:00
Stephen Worley 0885b1e3d9 zebra: implement protocol NHG Add/Del
Implement the underlying zebra functionality to Add/Del an
internal zebra and kernel NHG.

These NHGs are managed by the upperlevel protocols that send them
down via zapi messaging.

They are not put into the overall zebra NHG hash table and only
put into to the ID table. Therefore, different protos cannot
and will not share NHGs.

The proto is also set appropriately when sent to the kernel.

Expand the separation of Zebra hashed/shared/created NHGs and
proto created and mangaged NHGs.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-09-28 12:40:59 -04:00
Sebastien Merle 31f937fb43 lib, zebra: Add SR-TE policy infrastructure to zebra
For the sake of Segment Routing (SR) and Traffic Engineering (TE)
Policies there's a need for additional infrastructure within zebra.
The infrastructure in this PR is supposed to manage such policies
in terms of installing binding SIDs and LSPs. Also it is capable of
managing MPLS labels using the label manager, keeping track of
nexthops (for resolving labels) and notifying interested parties about
changes of a policy/LSP state. Further it enables a route map mechanism
for BGP and SR-TE colors such that learned BGP routes can be mapped
onto SR-TE Policies.

This PR does not introduce any usable features by now, it is just
infrastructure for other upcoming PRs which will introduce 'pathd',
a new SR-TE daemon.

Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-08-07 11:08:49 +02:00
Stephen Worley e22e80010e zebra: Use a nhe context dataplane and rib metaq
We will use a nhe context for dataplane interaction with
nextho group hash entries.

New nhe's from the kernel will be put into a group array
if they are a group and queued on the rib metaq to be processed
later.

New nhe's sent to the kernel will be set on the dataplane context
with approprate ID's in the group array if needed.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:40 -04:00
Quentin Young 303b93cdee zebra: update zebra_rib for vrrp
VRRP doesn't install any routes, but should still have an array entry.
Also add a help string for VRRP to route_types.txt

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17 00:27:08 +00:00
Quentin Young 4f576e7575 lib, vrrpd: define & use ZEBRA_ROUTE_VRRP
Allow Zebra to know our protocol name.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17 00:27:08 +00:00
Christian Franke 7c0cbd0e88 fabricd: add new daemon as build of isisd
fabricd is built using the sources of isisd. To allow differentiation
in the code, -DFABRICD=1 is added to its preprocessor flags.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:12 +02:00
Rafael Zalamena d3af6147a1 bfdd: re-route PTM-BFD daemon messages
When `bfdd` is enabled - which it is by default - re-route the PTM-BFD
messages to the FRR's internal BFD daemon instead of the external
PTM daemon.

This will help the migration of BFD implementations and avoid
duplicating code.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:04 -03:00
Donald Sharp 82557cf004 lib: Restrict redistribution cli a bit
The PBR and PIM daemons, needed the ability to connect
to zebra.  Unfortunately this connection also implied
an ability to redistribute to other valid protocols.

Add a additional hook to the route_types.pl script
to allow us to specify if the client type should
be redistributed at all.

Additionally cleanup the PIM code to not show up
as a protocol under the header for a 'show ip route'
command

Ticket: CM-20568
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-13 12:56:19 -04:00
Donald Sharp e5c83d9b31 pbrd: Add PBR to FRR
This is an implementation of PBR for FRR.

This implemenation uses a combination of rules and
tables to determine how packets will flow.

PBR introduces a new concept of 'nexthop-groups' to
specify a group of nexthops that will be used for
ecmp.  Nexthop-groups are specified on the cli via:

nexthop-group DONNA
  nexthop 192.168.208.1
  nexthop 192.168.209.1
  nexthop 192.168.210.1
!

PBR sees the nexthop-group and installs these as a default
route with these nexthops starting at table 10000
robot# show pbr nexthop-groups
Nexthop-Group: DONNA Table: 10001 Valid: 1 Installed: 1
	Valid: 1  nexthop 192.168.209.1
	Valid: 1  nexthop 192.168.210.1
	Valid: 1  nexthop 192.168.208.1

I have also introduced the ability to specify a table
in a 'show ip route table XXX' to see the specified tables.

robot# show ip route table 10001
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR,
       > - selected route, * - FIB route

F>* 0.0.0.0/0 [0/0] via 192.168.208.1, enp0s8, 00:14:25
  *                 via 192.168.209.1, enp0s9, 00:14:25
  *                 via 192.168.210.1, enp0s10, 00:14:25

PBR tracks PBR-MAPS via the pbr-map command:

!
pbr-map EVA seq 10
  match src-ip 4.3.4.0/24
  set nexthop-group DONNA
!
pbr-map EVA seq 20
  match dst-ip 4.3.5.0/24
  set nexthop-group DONNA
!

pbr-maps can have 'match src-ip <prefix>' and 'match dst-ip <prefix>'
to affect decisions about incoming packets.  Additionally if you
only have one nexthop to use for a pbr-map you do not need
to setup a nexthop-group and can specify 'set nexthop XXXX'.

To apply the pbr-map to an incoming interface you do this:

interface enp0s10
 pbr-policy EVA
!

When a pbr-map is applied to interfaces it can be installed
into the kernel as a rule:

[sharpd@robot frr1]$ ip rule show
0:	from all lookup local
309:	from 4.3.4.0/24 iif enp0s10 lookup 10001
319:	from all to 4.3.5.0/24 iif enp0s10 lookup 10001
1000:	from all lookup [l3mdev-table]
32766:	from all lookup main
32767:	from all lookup default

[sharpd@robot frr1]$ ip route show table 10001
default proto pbr metric 20
	nexthop via 192.168.208.1 dev enp0s8 weight 1
	nexthop via 192.168.209.1 dev enp0s9 weight 1
	nexthop via 192.168.210.1 dev enp0s10 weight 1

The linux kernel now will use the rules and tables to properly
apply these policies.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-06 13:22:43 -04:00
G. Paul Ziemba b9c7bc5ab0 bgpd: new vpn-policy CLI
PR #1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below.

The code of this PR implements the vpn-specific parts of this syntax:

router bgp <as> [vrf <FOO>]
    address-family <afi> unicast
        rd (vpn|evpn) export (AS:NN | IP:nn)
        label (vpn|evpn) export (0..1048575)
        rt (vpn|evpn) (import|export|both) RTLIST...
        nexthop vpn (import|export) (A.B.C.D | X:X::X:X)
        route-map (vpn|evpn|vrf NAME) (import|export) MAP

        [no] import|export [vpn|evpn|evpn8]
        [no] import|export vrf NAME

User documentation of the vpn-specific parts of the above syntax is in PR #1937

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-19 22:13:43 -07:00
G. Paul Ziemba 51ade3a27f lib: add BGP VPN route type
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-09 16:40:37 -05:00
Donald Sharp 8a71d93d85 sharpd: Add Super Happy Advanced Routing Protocol
Add a daemon that will allow us to test the zapi
as well as test route install/removal times from
the kernel.

The current commands are:

install route <starting ip address> nexthop <nexthop> (1-1000000)

This command starts installing at <starting ip address>/32
(1-100000) routes that it auto-increments by 1
Installation start time is noted in the log and finish
time is noted as well.

remove routes <starting ip address> (1-1000000)

This command removes routes at <starting ip address>/32
and removes (1-100000) routes created by the install route
command.

This code can be considered experimental and *is not*
something that should be run in a production environment.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-11-27 09:16:30 -05:00
David Lamparter 97bd5c48de Merge remote-tracking branch 'frr/master' into pull-624 2017-06-13 09:18:14 +02:00
Donald Sharp 1152f48669 lib: Add some breadcrumbs for new route types
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-07 15:47:35 -04:00
Donald Sharp ca10883edc *: Initial Import of Babeld into FRR
This is a direct copy of:
https://github.com/boutier/quagga-merge

From the branch babel-merge

I copied the babeld directory into FRR and then fixed up everything to
compile.

Babeld at this point in time when run will more than likely crash and burn
in it's interfactions with zebra.

I might have messed up the cli, which will need to be looked at

extract.pl.in and vtysh.c need to be fixed up.  Additionally we probably
need to work on DEFUN_NOSH conversion in babeld as well

This code comes from:
Matthieu Boutier <boutier@irif.fr>
Juliusz Chroboczek <jch@irif.fr>

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-13 14:59:41 -04:00
Donald Sharp 7f57883ee6 eigrp: Initial Commit
Please Note, I will be redoing this commit message with
more information.

Additionally I will rework the lib/* changes into their
own commits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-08 23:07:46 -05:00
Timo Teräs 2fb975da77 nhrpd: implement next hop resolution protocol
This provides DMVPN support and integrates to strongSwan. Please read
README.nhrpd and README.kernel for more details.

[DL: cherry-picked from dafa05e65fe4b3b3ed5525443f554215ba14f42c]
[DL: merge partially resolved, this commit will not build.]
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-07 16:20:29 +01:00
Donald Sharp 3b14d86eed Merge remote-tracking branch 'origin/stable/2.0' 2017-01-06 09:58:21 -05:00
G. Paul Ziemba 5ee62c66a9 BGP: deal with vnc related string ambiguities (issue #9)
- "redist foo" parsing modified to check for foo==vnc and foo==vnc-direct
      instead of just leading 'v' character
    - string designating ZEBRA_ROUTE_VNC_DIRECT changed from "vpn" to "vnc-direct"
    - route_types.pl parser recognizes 7th field to restrict availability
      of a route type in the redist command to specific daemons
    - restrict "vnc-direct" to bgpd only (doesn't make sense elsewhere)
    - vnc documentation updated to match

Signed-off-by: Lou Berger <lberger@labn.net>
2017-01-02 15:04:47 -05:00
Quentin Young 0a538fc98f Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	isisd/isis_routemap.c
	zebra/rt_netlink.c
2016-10-20 16:31:49 +00:00
Renato Westphal a695cc7b80 zebra/ldpd: introduce ZEBRA_ROUTE_ALL wildcard route type
The ZEBRA_ROUTE_ALL route type can be used by a client to request
all routes from zebra. The main motivation for introducing this is
to allow ldpd to get routes from all OSPF instances, not only from
the default one. Without ZEBRA_ROUTE_ALL, ldpd would need to send a
ZEBRA_REDISTRIBUTE_ADD message for each possible OSPF instance (65k),
which doesn't scale very well.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-10-18 08:51:23 -04:00
Quentin Young e52702f29d Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	bgpd/bgp_route.c
	bgpd/bgp_routemap.c
	bgpd/bgp_vty.c
	isisd/isis_redist.c
	isisd/isis_routemap.c
	isisd/isis_vty.c
	isisd/isisd.c
	lib/command.c
	lib/distribute.c
	lib/if.c
	lib/keychain.c
	lib/routemap.c
	lib/routemap.h
	ospf6d/ospf6_asbr.c
	ospf6d/ospf6_interface.c
	ospf6d/ospf6_neighbor.c
	ospf6d/ospf6_top.c
	ospf6d/ospf6_zebra.c
	ospf6d/ospf6d.c
	ospfd/ospf_routemap.c
	ospfd/ospf_vty.c
	ripd/rip_routemap.c
	ripngd/ripng_routemap.c
	vtysh/extract.pl.in
	vtysh/vtysh.c
	zebra/interface.c
	zebra/irdp_interface.c
	zebra/rt_netlink.c
	zebra/rtadv.c
	zebra/test_main.c
	zebra/zebra_routemap.c
	zebra/zebra_vty.c
2016-10-17 23:36:21 +00:00
Renato Westphal b2d4d0393a *: rename all instances of OSPFv6 to OSPF6 or OSPFv3
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-10-13 00:59:19 +00:00
Lou Berger 65efcfce42 bgpd: add L3/L2VPN Virtual Network Control feature
This feature adds an L3 & L2 VPN application that makes use of the VPN
and Encap SAFIs.  This code is currently used to support IETF NVO3 style
operation.  In NVO3 terminology it provides the Network Virtualization
Authority (NVA) and the ability to import/export IP prefixes and MAC
addresses from Network Virtualization Edges (NVEs).  The code supports
per-NVE tables.

The NVE-NVA protocol used to communicate routing and Ethernet / Layer 2
(L2) forwarding information between NVAs and NVEs is referred to as the
Remote Forwarder Protocol (RFP). OpenFlow is an example RFP.  For
general background on NVO3 and RFP concepts see [1].  For information on
Openflow see [2].

RFPs are integrated with BGP via the RF API contained in the new "rfapi"
BGP sub-directory.  Currently, only a simple example RFP is included in
Quagga. Developers may use this example as a starting point to integrate
Quagga with an RFP of their choosing, e.g., OpenFlow.  The RFAPI code
also supports the ability import/export of routing information between
VNC and customer edge routers (CEs) operating within a virtual
network. Import/export may take place between BGP views or to the
default zebera VRF.

BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VPN
information between NVAs. BGP based IP VPN support is defined in
RFC4364, BGP/MPLS IP Virtual Private Networks (VPNs), and RFC4659,
BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN . Use
of both the Encapsulation Subsequent Address Family Identifier (SAFI)
and the Tunnel Encapsulation Attribute, RFC5512, The BGP Encapsulation
Subsequent Address Family Identifier (SAFI) and the BGP Tunnel
Encapsulation Attribute, are supported. MAC address distribution does
not follow any standard BGB encoding, although it was inspired by the
early IETF EVPN concepts.

The feature is conditionally compiled and disabled by default.
Use the --enable-bgp-vnc configure option to enable.

The majority of this code was authored by G. Paul Ziemba
<paulz@labn.net>.

[1] http://tools.ietf.org/html/draft-ietf-nvo3-nve-nva-cp-req
[2] https://www.opennetworking.org/sdn-resources/technical-library

Now includes changes needed to merge with cmaster-next.
2016-10-03 08:17:02 -04:00
Renato Westphal eac6e3f027 ldpd: adapt the code for Quagga
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23 09:31:09 -04:00
David Lamparter 12e41d03bd pimd: merge pimd as of 2015-01-19
Welcome pimd to the Quagga daemon zoo!

This is a merge of commit 77ae369 ("pimd: Log ifindex found for an
interface when zebra lib reports a new connected address."), with
the intermediate "reconnect" changes removed (c9adf00...d274381).
d274381 is replaced with b162ab7, which includes some changes.  In
addition, 4 reconnect-related changes and 1 cosmetic one have been
bumped out.

The rebase command used to produce the branch that is merged here is:
  git rebase --onto b162ab7 c9adf00 77ae369

Note that 3 patches had their author rewritten from
    "Anonymous SR#108542 <>" (which is not a valid git author ID)
to: "Savannah SR#108542 <nbahr@atcorp.com>" (which is the e-mail address
                               listed in the associated Savannah ticket)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-25 20:38:32 -04:00
Daniel Walton 41d9cc6a65 quagga: remove babel
Ticket: CM-9274
Reviewed By: sharpd@cumulusnetworks.com
Testing Done:

<DETAILED DESCRIPTION (REPLACE)>
2016-02-11 08:55:24 -08:00
Donald Sharp 7a4bb9c54e zebra-redistribute-table.patch
Zebra: Redistribute routes from non-main kernel table to main.

This can be the basis for many interesting features such as variations
of redistribute ARP, using zebra as the RIB in the presence of multiple
routing protocol stacks etc. The code only supports IPv4 for now, but
the infrastructure is in place for IPv6.

Usage:
There is a new route type introduced by this model: TABLE. Routes
imported from alternate kernel tables will have their protocol type set to
TABLE.

Routes from alternate kernel tables MUST be first imported into the main
table via "ip import-table <table id>". They can then be redistributed via
a routing protocol via the "redistribute table" command. Each imported table
can an optional administrative distance specified. In Zebra, a route with a
lower distance is chosen over routes with a higher distance. So, distance
is how the user can choose to prioritize routes from a particular table over
routes from other tables or routes learnt another way in zebra.

Route maps for imported tables are specified via "ip protocol" command in
zebra. Route maps for redistributed routes within a routing protocol are
subject to the route map options supported by the protocol. The
"match source-protocol" option in route maps can match against "table"
to filter routes learnt from alternate kernel routing tables.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
2015-05-19 18:03:42 -07:00
Paul Jakma 5734509c05 babeld: Initial import, for Babel routing protocol.
* Initial import of the Babel routing protocol, ported to Quagga.
* LICENCE: Update the original LICENCE file to include all known potentially
  applicable copyright claims.  Ask that any future contributors to babeld/
  grant MIT/X11 licence to their work.
* *.{c,h}: Add GPL headers, in according with the SFLC guidance on
  dealing with potentially mixed GPL/other licensed work, at:

  https://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
2012-03-25 17:06:51 +01:00
David Lamparter e0ca5fde7b lib: put route_types.txt to real use
this replaces most occurences of routing protocol lists by preprocessor
defines from route_types.h. the latter is autogenerated from
route_types.txt by a perl script (previously awk). adding a routing
protocol now is mostly a matter of changing route_types.txt and log.c.

Conflicts:

	lib/route_types.awk
2011-12-13 19:13:17 +04:00
Paul Jakma 9c42a6ebbc [lib] Centralise Zserv route type information, auto-generate redist strings
2006-05-23 Paul Jakma <paul.jakma@sun.com>

	* route_types.txt: New file, table of ZEBRA_ROUTE definitions.
	* route_types.awk: New script, to parse previous and generate
	  (for now) redistribute string defines.
	* Makefile.am: build route_types.h using previous two, ala
	  memtypes.h, include the script and table file in EXTRA_DIST.
	* command.h: pull in route_types.h, add a REDIST_STR define.
2006-06-27 07:52:03 +00:00