Philippe Guibert [Mon, 23 Jan 2017 13:47:35 +0000 (14:47 +0100)]
tests: fix bgp print in tests
This commit is a fix from previous commit: Quagga: AFI/SAFI mappings
IANA to/from internal values. It removes the printf that was used for
troubleshooting the afi/safi change, in respect to testing.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Tue, 17 Jan 2017 21:26:33 +0000 (22:26 +0100)]
bgpd: use HAVE_EVPN to disable evpn frame handling
Transmission and Reception routines have a part of code that is
conditionnally compiled to the usage of HAVE_EVPN. Also, each time a
subfield of prefix evpn is reached, like in configuration also, then a
conditionnaly compilation with HAVE_EVPN is used.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Fri, 20 Jan 2017 13:02:49 +0000 (14:02 +0100)]
bgpd: update mp_nexthop field in case mp-bgp entry is created
In case a manual set of MPLS, ENCAP, or EVPN entry is set, then the
nexthop attribute localted in attr->extra structure must be changed too.
In standard cases, where IPv4 IGP nexthop address is picked up, the same
address ie chosen.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Thu, 27 Oct 2016 06:02:36 +0000 (08:02 +0200)]
bgpd: enhance network command for evpn route type 5
A new vty command available under evpn address family. This command
takes following format:
(af-evpn)# [no] network <A.B.C.D/M|X:X::X:X/M> rd ASN:nn_or_IP-address:nn ethtag WORD
label WORD esi WORD gwip A.B.C.D routermac WORD
[route-map WORD]
Among new parameters, ethtag stands for the ethernet tag indentifier.
ESI stands for the ethernet segment identifier, and must be entered in
following format: 00:11:22:33:44:55:66:77:88:99.
gwip stands for the gateway IP address contained in RT5 message. A
check is done on that value since if gwip is ipv4, then ip prefix must
be ipv4. The same for ipv6.
RouterMAc is the gateway mac address sent as extended community
attribute.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Julien Courtat [Tue, 18 Oct 2016 09:05:26 +0000 (11:05 +0200)]
bgpd: fix display of ethernet vpn route prefix in vty
L2VPN route prefix are composed of ethtag, mac address and ip address.
vty command "show bgp l2vpn rd <>" show macip prefix in the following
template: [ethtag][macaddress/len][ipaddress/len]
Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
e
This patch introduces show show bgp evpn commands to dump
NLRI entries configured or received on BGP, related to EVPN
New command introduced is the following:
show [ip] bgp l2vpn evpn [all | rd <rd name> ] [overlay]
Like for MPLS, similar set of commands is added for EVPN:
show [ip] bgp l2vpn evpn [all|rd <RDNAME>]
show [ip] bgp l2vpn evpn all neighbor <NEIGHBOR> routes
show [ip] bgp l2vpn evpn all neighbor <NEIGHBOR> advertised-routes
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
For each received routermac extended community, the mac address is
copied into routermac extended community context. For each emission,
a check is done against routermac extended community, if L2VPN is
enabled. If enabled, the extended community is appended.
Signed-off-by: Philippe Gubiert <philippe.guibert@6wind.com>
Philippe Guibert [Wed, 10 Aug 2016 08:46:53 +0000 (10:46 +0200)]
bgpd: introduction of vxlan tunnel attribute
As per draft-ietf-idr-tunnel-encaps-02, section 3.2.1, BGP Encap
attribute supports vxlan tunnel type. A new tunnel attribute has been
appended to subtlv list, describing the vxlan network identifier to
be used for the routing information of the BGP update message.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
As per draft-ietf-bess-evpn-inter-subnet-forwarding-01, chapter 6.1,
a new extended community called router's MAC Extended Community is
provided. This community is appended to extended community list.
Note that a show API has been changed in order to be able to not
display (or not) this new type.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: enhance reception of bgp ext. community default gateway
This fix permits processing of default gateway extended
community if present. This option, if router mac option is not
present, will replace it.
Also, when exporting route entry to VRF RIB, if VRF is layer 2
type, then the ecommunity related to mac address and router mac
are stripped.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Tue, 17 Jan 2017 21:21:40 +0000 (22:21 +0100)]
lib: add define of compilation for EVPN in prefix.c
Because the prefix structure may include or not evpn sub structure, then
HAVE_EVPN compilation define is also used in prefix.c, because it
references the sub field evpn of prefix structure.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This patch introduces the ability to make route type 5 message
when EVPN is enabled. Picked up paramters are collected from the
bgp extra attribute structure and are the ESI, the ethernet tag
information. In addition to this, nexthop attribute is collected too.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This patch appends nexthop attribute to EVPN message, in addition
to appending gateway IP in RT-5 NLRI itself. In reception, if
both informations are stored, then the GW IP information will
supersede the NLRI nexthop attribute.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: route type 5 internal structures plus processing
The commit introduces the changes to be done to carry route type 5 EVPN
information in bgp extra attribute information. The commit also handles
the update processing for route type 5 information, including ESI,
gatewayIP and label information.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Mon, 23 Jan 2017 13:42:02 +0000 (14:42 +0100)]
tests: update bgp_nlri_parse function usage in bgp testing
Because the bgp_nlri_parse function has been extended with one parameter,
when doing bgp testing against some packets, the correct call to
bgp_nlri_parse must be done.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This patch introduces code to receive a NLRI message with route type
5, as defined in draft-ietf-bess-evpn-prefix-advertisement-02. It
It increases the number of parameters to extract from the NLRI and
to store into bgp extra information structure. Those parameters are
the ESI (ethernet segment identifier), the gateway IP Address (which
acts like nexthop attribute but is contained inside the NLRI itself)
and the ethernet tag identifier ( that acts for the VXLan Identifier)
This patch updates bgp_update() and bgp_withdraw() api, and then does the
necessary adapations for rfapi.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Wed, 26 Oct 2016 10:21:53 +0000 (12:21 +0200)]
bgpd: enhance structures and esi and mac functions to handle EVPN
EVPN introduces new objects to be handled: Ethernet Segment Identifier,
and MAC Address.
For Route type 5 message, it also involves gateway IP field that can be
either IPv4 or IPv6 address. This commit introduces those main structures.
It also introduces some functions to convert esi and mac address to
string, and vice-versa.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Introduction of EVPN address-family node that is reachable under
BGP node, like follow: address-family evpn. Under that node, only
some commands are available for configuring a neighbor or setting
some basic settings like attribute unchanged behaviour. Currently,
no vty command is available for setting NLRI entries for EVPN.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Thu, 27 Oct 2016 08:24:44 +0000 (10:24 +0200)]
lib: afi_ether structure packing fix
'packed' keyword had no effect on packing the afi_ethernet structure.
The attribute keyword has been eppended in order to take into account
the packed feature.
Philippe Guibert [Thu, 12 Jan 2017 09:14:18 +0000 (10:14 +0100)]
lib: add prefix support for evpn route type 5
The requirement from draft-ietf-bess-evpn-prefix-advertisement-03
mentions that the Eth-Tag ID, IP Prefix Length and IP Prefix will be
part of the route key used by BGP. The ip prefix length is then appended
to the evpn_addr. In addition to this, the ethernet tag ID is reused.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
To support EVPN, a new AFI and SAFI value are defined here.
For internal processing, two other values are used. Those values will
be used to reach RIB entries by using internal afi and safi values
as indexes. This commit is using naming convention for using EVPN.
External value exchanged in BGP packets is called of with
IANA_ presence in macro, while internal value will not have _IANA_
presence.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Thu, 12 Jan 2017 10:04:06 +0000 (11:04 +0100)]
configure: add enable-evpn support
By default, EVPN is disabled by default. In order to support it, the
configure command has been made available in order to introduce a define
that is used for compilation.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
David Lamparter [Tue, 14 Feb 2017 02:31:26 +0000 (03:31 +0100)]
ospfclient: fix gcc -O0 build
the "static const" inside DECLARE_MTYPE still causes issues on gcc -O0
(re. gcc bug 69981). Work around by disabling MTYPE declarations for
ospfclient.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Fri, 16 Dec 2016 22:27:39 +0000 (23:27 +0100)]
lib: parser: rewrite token deduplication
Merge the parsed graph into the existing one as a separate step. This
makes it possible to merge identical subgraphs, which is used e.g. in
bgpd for <A.B.C.D|X:X::X:X|WORD> neighbor names.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 9 Feb 2017 11:59:44 +0000 (12:59 +0100)]
ospfclient: #include sources
Pulling in source files from another directory breaks automake's
distclean target, and there seems to be no good fix for this...
(particularly since we need -fPIC build for a DSO here, while ospfd
compiles for an executable...)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Renato Westphal [Tue, 7 Feb 2017 13:42:01 +0000 (11:42 -0200)]
zebra: fix uninstallation of LDP labeled static routes
Problem:
1 - Add a static route: "ip route 10.0.0.0/24 172.16.1.1";
2 - Receive an LDP mapping for 10.0.0.0/24 from 172.16.1.1;
3 - Remove the static route: "no ip route 10.0.0.0/24 172.16.1.1".
4 - Static route is removed but not uninstalled from the kernel.
What happens is that, on static_uninstall_route(), we can't find the
route we want to uninstall because it has an LDP label where the original
static route doesn't have any MPLS label.
To fix this, we can just stop calling static_nexthop_label_same() and
remove this function. It's impossible to have two routes for the same
prefix with the same distance and same nexthop address. This means that
we can lookup the correct route to uninstall without having to check
its labels.
Donald Sharp [Tue, 7 Feb 2017 19:55:39 +0000 (14:55 -0500)]
bgpd: Fix usage of uninitialized dn_flag[]
dn_flag was tested inside of a 'use_json' block
further down in the function. Move initialization
of the value to outside of the !use_json if statement
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>