Commit Graph

221 Commits

Author SHA1 Message Date
Donald Sharp
6a527b2fc1 bgpd: Fix some build issues from removing HAVE_CUMULUS
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-28 20:57:36 -04:00
Donald Sharp
f00ba69963 bgpd: Use correct data size
a vni_t is 32 bit, so we only need to use a normal
integer for json commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-28 20:45:32 -04:00
Donald Sharp
e093d9d57b bgpd: Remove HAVE_CUMULUS from evpn commands
In order to make EVPN behavior work without special casing
the code, bring the evpn commands under HAVE_CUMULUS into
the fold.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-28 20:18:17 -04:00
Chirag Shah
99b4e972b5 bgpd: fix default RD value in running-cfg
When bgp vrf is configured with non-default
RD value, config flag is set.
Upon removing non-default RD value the flag was not reset,
thus displayed default RD value in running-config.

router bgp 5550 vrf vrf1
 rd 45.0.2.2:5

Unset the RD configuration flag under bgp_vrf instance.

Ticket:CM-20206

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-06-15 22:19:08 -07:00
Chirag Shah
a2a8153f4e bgpd: accept vni rd_rt command for default vrf
L2VNI route-distinguisher and route-target configuartions
should only applied under DEFAULT VRF bgpd instance.

Add newline to each vni display.

router bgp 65006
  address-family l2vpn evpn
    vni 1000101
      route-target import 1:1000101

do not allow under
router bgp 65006 vrf RED

Ticket:CM-20204
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-06-09 17:35:37 -07:00
Quentin Young
b482a7fd83 bgpd: fix missing docstring
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-04 21:51:07 +00:00
Donald Sharp
2bb9eff45f bgpd, lib: Cleanup CI warnings from system
Make the CI system happy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-30 07:48:21 -04:00
mitesh
50f74cf131 *: support for evpn type-4 route
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-30 07:48:20 -04:00
Quentin Young
568b6b444e bgpd: sort vni's in running config
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-05-25 16:39:38 +00:00
Donald Sharp
51f9d3e70f
Merge pull request #2034 from vincentbernat/fix/rfc8365-auto-rt
bgpd: add an option for RT auto-derivation to use RFC 8635.
2018-05-16 12:13:04 -04:00
Donald Sharp
dcfe47166a bgpd: Fix compiler warning->errors of might be used uninited
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Mitesh Kanjariya
d2a0075ac2 bgpd: write route-map to config for advertise type5 commands
We enable/disable type-5 routes by following commands:
advertise ipv4 unicast [route-map <route-map>]
advertise ipv6 commands [route-map <route-map>]
the route-map part was writtem to conf file.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
Mitesh Kanjariya
d4f7497ebd bgpd: no advertise ipv6 unicast comand should unset the af_flags
no advertise ipv6 unicast command should unset the corresponding
af_flag in bgp_vrf rather than the vrf_flags.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-05-08 19:24:15 -04:00
vivek
2dd3221735 bgpd: Display table version for EVPN routes
Display the table version for EVPN routes like it is done for other
address families. Note that this is really relevant only for the
per-VNI routing table.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>

Ticket: CM-12903
2018-05-08 19:24:15 -04:00
Vincent Bernat
bf1061d876 bgpd: add an option for RT auto-derivation to use RFC 8635.
RFC 8635 explains how RT auto-derivation should be done in section
5.1.2.1 [1]. In addition to encoding the VNI in the lowest bytes, a
3-bit field is used to encode a namespace. For VXLAN, we have to put 1
in this field. This is needed for proper interoperability with RT
auto-derivation in JunOS. Since this would break existing setup, an
additional option, "autort rfc8365-compatible" is used.

[1]: https://tools.ietf.org/html/rfc8365#section-5.1.2.1

Signed-off-by: Vincent Bernat <vincent@bernat.im>
2018-04-23 17:05:23 +02:00
Russ White
5e572e886a
Merge pull request #2057 from donaldsharp/fix_1916
Fix 1916
2018-04-20 07:56:48 -04:00
Mitesh Kanjariya
689b510143 bgpd: change advertise-subnet to a hidden command
We have changed the flow in which we advertise the VNI subnet.
We will mark this command as hidden for all future purposes.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-04-12 09:05:28 -04:00
Vincent Bernat
554cd77a6a bgpd: add basic support for ETI and ESI for BGP EVPN
Ethernet Tag ID (ETI) is part of the prefix. It cannot just be ignored
as it needs to be used when checking for prefix uniqueness. Moreover,
when using Quagga as a route reflector, we need to keep its
value. Therefore, we correctly parse and encode it. We also parse
ESI. While not part of the prefix, it needs to be reflected correctly
by Quagga.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
2018-04-09 11:42:08 +02: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
vivek
e779dc7666 bgpd: Fix EVPN prefix route advertisement for IPv6
Fix incorrect check in command.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-03-16 23:25:29 +00:00
Philippe Guibert
c1a0038782
Merge pull request #1806 from vivek-cumulus/evpn-ipv6-tenant-routing
*: EVPN symmetric routing for IPv6 tenant routes
2018-03-13 10:20:29 +01:00
Mitesh Kanjariya
9bb3ca515b
Merge branch 'master' into type5-default-originate 2018-03-12 14:47:28 -07:00
vivek
4e262455a2 Merge branch 'master' of https://github.com/frrouting/frr into evpn-ipv6-tenant-routing
Conflicts:
	bgpd/bgp_evpn.c
2018-03-10 04:03:41 +00: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
vivek
1ec31309bb *: EVPN symmetric routing for IPv6 tenant routes
Implement support for EVPN symmetric routing for IPv6 routes. The next hop
for EVPN routes is the IP address of the remote VTEP which is only an IPv4
address. This means that for IPv6 symmetric routing, there will be IPv6
destinations with IPv4 next hops. To make this work, the IPv4 next hops are
converted into IPv4-mapped IPv6 addresses.

As part of support, ensure that "L3" route-targets are not announced with
IPv6 link-local addresses so that they won't be installed in the routing
table.

Signed-off-by: Vivek Venkatraman vivek@cumulusnetworks.com
Reviewed-by: Mitesh Kanjariya mitesh@cumulusnetworks.com
Reviewed-by: Donald Sharp sharpd@cumulusnetworks.com
2018-02-28 02:07:23 +00:00
Mitesh Kanjariya
58f9e4d3f2
Merge branch 'master' into type5-default-originate 2018-02-27 12:52:24 -08:00
Mitesh Kanjariya
83ea2eb026
Merge branch 'master' into evpn-bugs 2018-02-27 02:00:10 -08:00
Mitesh Kanjariya
23e386ac71
Merge branch 'master' into type5-default-originate 2018-02-27 01:46:26 -08: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
mitesh
3f230b347b bgpd: remove show bgp l2vpn evpn route vrf cmd
This command doesnt make sense as EVPN routes are only present in
global table.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-27 01:14:43 -08:00
Mitesh Kanjariya
a75c25534a bgpd: write vrf rd to config
When a non-default vrf rd is configured under l2vpn evpn in a vrf,
we need to update the config file.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-27 01:14:43 -08:00
Mitesh Kanjariya
db29a4a8bc bgpd: move route-target for a vrf under address-family evpn command
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-27 01:14:43 -08:00
Mitesh Kanjariya
ee851c8c77 bgpd: add show bgp vrf all l2vpn evpn summary as an option
Ticket: CM-19738
Review: CCR-7194
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-27 01:14:43 -08:00
Mitesh Kanjariya
486456ca92 bgpd: support for default-originate type-5 route
Implement support for 'default-originate' for L2VPN/EVPN address family.
This is needed for the case where external routing within a POD,
will follow the default route to the border/exit leaf.
The border leaf has more than one next hop to forward the packet on to,
depending on the destination IP.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-22 17:31:58 -08:00
Mitesh Kanjariya
154faa5007 bgpd: move l2vpn evpn related flags in struct bgp to af_flags
We have af_flags in struct bgp to hold address family related flags,
l2vpn evpn flags to indicate advertise ipvX unicast should be moved there.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-22 17:24:36 -08:00
Mitesh Kanjariya
fdf19f06f2 bgpd: allow advertise-subnet cmd without enabling advertise ipv4 unicast
Type-5 routes can be useful in multiple scenarios such as advertise-subnet,
default-originate etc. Currently, the code has a restriction that to allow
advertising type-5 routes, user has to first enable advertise ipvX command.
This restriction is not necessary and should be removed.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-22 17:23:07 -08:00
Donald Sharp
100cb793cc bgpd: Fix value set but never used
The value 'pnt' was being set but never used.  If we need
this in the future it will be a simple thing to add back
in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-02-17 14:59:32 -05:00
Mitesh Kanjariya
53c84f7800 bgpd: Policy to control which RIB routes are injected into EVPN
FRR/CL provides the means for injecting regular (IPv4) routes
from the BGP RIB into EVPN as type-5 routes.
This needs to be enhanced to allow selective injection.
This can be achieved by adding a route-map option
for the "advertise ipv4/ipv6 unicast" command.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-02-12 16:02:15 -08: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
vivek
b3628c7095 bgpd: Fix EVPN type-5 route display
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>

Ticket: CM-19131
Reviewed By: None (trivial)
Testing Done: Manual
2018-01-23 16:27:25 -08:00
vivek
d445462649 *: Reintroduce JSON keywords for EVPN
Bring back "numVnis" and "originatorIp" for backwards compatibility.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>

Ticket: CM-19119
Reviewed By: Trivial
Testing Done: Manual, evpn_tests.py
2018-01-23 16:27:25 -08:00
Mitesh Kanjariya
aa9db9e6e2 bgpd: filter for prefix route in route rd commands
Ticket: CM-19000
Review: crr-7008
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 16:24:39 -08:00
Mitesh Kanjariya
47b7136955 bgpd: provide filter for ip prefix route in bgp l2vpn evpn route cmd
Ticket: CM-19000
Review: ccr-7008
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 16:24:39 -08:00
Mitesh Kanjariya
fb8384733f bgpd: fix show bgp l2vpn evpn vni command
We bail in the command if no l2vnis are present.
This is incorrect as we now print both l2 and l3 vnis together.

Ticket: CM-19022
Review: Trivial
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 16:23:31 -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
31310b25f2 bgpd: advertise VNI subnet
In EVPN symmetric routing, not all subnets are presents everywhere.
We have multiple scenarios where a host might not get learned locally.
1. GARP miss
2. SVI down/up
3. Silent host

We need a mechanism to resolve such hosts. In order to achieve this,
we will be advertising a subnet route from a box and that box will help
in resolving the ARP to such hosts.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2018-01-23 15:58:53 -08:00
Mitesh Kanjariya
9bb77a5b3d
Merge branch 'master' into evpn-symmetric-routing 2018-01-11 09:00:23 -08:00
mitesh
523cafc418 bgpd, lib, zebra: fix style problems
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-27 11:47:10 -08:00
Raymond P. Burkholder
fb8f41e455 bgpd: fixed '-Werror=maybe-uninitialized' warnings
- used @sharpd's slack patch as a starting point
- fixes compile time issue, but code path not tested

Signed-off-by: Raymond P. Burkholder <github@oneunified.net>
2017-12-19 08:15:44 -05:00
Mitesh Kanjariya
bf48830b01 bgpd: move vrf rd command under address-family l2vpn evpn
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
Mitesh Kanjariya
6ee86383bb bgpd: write advertise <ipv4|ipv6> unicast under bgp vrf config
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
Mitesh Kanjariya
053905d2e3 bgpd: follow AFI/SAFI style for advertising/withdrawing type-5 routes
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
Mitesh Kanjariya
06d2e8f3ba bgpd: update/withdraw type-5 routes upon l3-vni add/del
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:08 -08:00
Mitesh Kanjariya
94c2f693a4 bgpd: evpn enabled should only be checked for default instance
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
mitesh
342dd0c623 bgpd: advertise/withdraw type-5 routes upon user config
CLI config for enabling/disabling type-5 routes

router bgp <as> vrf <vrf>
  address-family l2vpn evpn
    [no] advertise <ipv4|ipv6|both>

loop through all the routes in VRF instance and advertise/withdraw
all ip routes as type-5 routes in default instance.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
mitesh
b67a60d2cf bgpd: set vrf originator ip to kernels local-ip
For EVPN type-5 route the NH in the NLRI is set to the local tunnel ip.
This information has to be obtained from kernel notification.
We need to pass this info from zebra to bgp in l3vni call flow.
This patch doesn't handle the tunnel-ip change.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
mitesh
676f83b991 bgpd: RD derivation for VRF
1. VRF RD can be auto-derived (simillar to RD for a VNI)
2. VRF RD can be configured manually through a config

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
df399d1cb1 bgpd: move vrf RT command under address-family l2vpn evpn
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
mitesh
bb7a24aba9 zebra: use list_delete_and_null instead of list_delete
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
6be9a2087f bgpd: adjust show bgp l2vpn evpn vni command to avoid sanity breakages
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:07 -08:00
Mitesh Kanjariya
ceb9a9210b bgpd: json support for show bgp vrf <> l3vni info
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
Mitesh Kanjariya
181c08c6fc bgpd: json support for show bgp l2vpn evpn vrf-import-rt
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:06 -08:00
mitesh
d3135ba31d bgpd: program mac-ip routes in matching vrfs
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
Mitesh Kanjariya
10ebe1ab54 bgpd: import rt to vrf mapping
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
Mitesh Kanjariya
6a8657d0f0 bgpd: link l2vnis(bgpevpn) to l3vni(vrf)
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
Mitesh Kanjariya
c581d8b0f4 bgpd: import/export rt for BGP vrf
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
Mitesh Kanjariya
29c539221f bgpd: Bgpevpn tenant vrf association
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-12-14 10:57:05 -08:00
Donald Sharp
06b9f471ab bgpd: Fixup buffer sizes for prefix_rd2str
The prefix_rd2str uses a buffer size of RD_ADDRSTRLEN.
Modify the code to consistently use this for all of BGP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-12-11 12:39:16 -05:00
Donald Sharp
f57514e10e bgpd: Fix 'not initialized' possibly on older compilers
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-18 18:39:04 -04:00
Renato Westphal
8034beff9f *: use argv[]->text instead of argv[]->arg when appropriate
Incomplete commands like "debug ospf6 route mem" were being ignored. The
changes in ripd and ripngd are intended to make the code easier to read,
no bugs were fixed in these two daemons.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-05 22:54:42 -03:00
Sebastian Lohff
078af92eac bgpd: Fix defualt-default typo in bgp evpn help text
Signed-off-by: Sebastian Lohff <seba@someserver.de>
2017-10-04 22:15:01 +02: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
Donald Sharp
1ae43f88ea bgpd: Fix unused variable
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-25 12:49:10 -04:00
Philippe Guibert
197cb53000 bgpd: vty command fixup for evpn rt5
evpn vty command can be used to configure evpn rt5 entries.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-09-25 18:31:11 +02:00
Mitesh Kanjariya
8367c32764 bgpd: Intialize all the variables used in argv_find.
Ticket: CM-17706
Review: CCR-6639
Testing: Manual (test failing in min test for ARM)

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-09-20 14:56:23 -07:00
Daniel Walton
d114b977e9 *: support keywords that begin with uppercase letter
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

VARIABLE tokens must be all uppercase, this allows us to support WORD
tokens that begin with an uppercase letter.  The "Null0" keyword is an
example of where this is needed.

The only VARIABLE we had that wasn't already all uppercase was
ASN:nn_or_IP-address:nn
2017-09-14 18:07:30 +00:00
Lou Berger
323a4653ce Merge pull request #1169 from donaldsharp/eas_crud
bgpd: Fix warning introduced by PR #1133
2017-09-13 13:19:23 -04:00
Quentin Young
5a0ccebf91
bgpd: deduplicate struct definition
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-13 11:47:35 -04:00
Donald Sharp
88a837f6ce bgpd: Fix warning introduced by PR #1133
I am merely fixing the compiler warning.  I do not
understand what the as value should be for output
to the end user or where it should be retrieved
from.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-13 09:14:46 -04:00
David Lamparter
937652c6e4 *: fix be32 reading / 24-bit left shift
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-09-09 19:50:58 +02: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
Donald Sharp
32592ffb4f Merge pull request #1056 from opensourcerouting/oldbits-0
"pathspace" options, vtysh-suid-cleanups, "vty_frame()"
2017-08-29 17:48:36 -04:00
David Lamparter
ea47320b1d bgpd: remove some deep nesting
Some of this was so egregiously stupid, I couldn't look at it without
gouging my eyes out...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-29 08:36:03 +02:00
David Lamparter
2b79110731 bgpd: get rid of afi_header_vty_out() & co.
afi_header_vty_out() is easily replaced with vty_frame(), which means we
can drop a whole batch of "int *write" args as well as the entirety of
bgp_config_write_family_header().

=> AFI/SAFI config writing is now a lot simpler.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-29 08:36:03 +02:00
Mitesh Kanjariya
0291c246db fix coding style
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-18 22:43:09 -07:00
vivek
b682f6de5a zebra: Fix MAC change handling for a neighbor
When the MAC changes for a local neighbor, ensure that the neighbor data
structure as well as the link between the neighbor and MAC data structures
is updated correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-17565
Reviewed By: CCR-6605
Testing Done: Manual, evpn-smoke
2017-08-17 03:54:38 -07:00
Mitesh Kanjariya
dff8f48da3 bgpd: Add advertsie-all-vni in show bgp neighbor
Ticket: CM-17249
Review: CCR-6558
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-17 02:05:53 -07:00
Mitesh Kanjariya
9c92b5f768 bgpd: Json support for evpn commands
Ticket:CM-16241
Reviewed By:CCR-6451
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-17 01:29:07 -07:00
Donald Sharp
a85b24cc7f bgpd: Use JSON_STR
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-08 10:30:13 -04:00
Mitesh Kanjariya
ddd16ed5f2 bgpd/zebra: honor tunnel ip change in bgp regardless of vni readiness
Ticket: CM-17014
Review: CCR-6432
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:28:54 -04:00
Daniel Walton
640751c7ac EVPN: Indentation is off for route-target export
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-16967
2017-08-08 10:28:51 -04:00
Mitesh Kanjariya
5bc2ed52f0 bgpd: fix crash while configuring rt
Ticket: CM-16410
Review: CCR-6409
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:28:51 -04:00
Daniel Walton
5014d96f0f bgpd, tools, vtysh: Handle config migration from 'address-family evpn' to 'address-family l2vpn evpn'
Ticket: CM-16747
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-08 10:28:50 -04:00
Mitesh Kanjariya
1a98c08704 bgpd/zebra/lib: EVPN support for asymmetric VxLan routing
1. Advertise gateway mac-ip in EVPN
2. Advertise VRR mac-ip in EVPN
3. Ignore gateway mac-ip advertisements in case of distributed gateway
4. Config knob to enable/disable gateway mac-ip advertisements

Ticket: CM-16456, CM-16543, CM-16555, CM-16778
Review: CCR-6283
Unit-test: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-08-08 10:28:46 -04:00
vivek
f2d622627b bgpd: Update EVPN operational commands
Make EVPN operational commands follow the "<afi> <safi>" syntax.
The relevant commands are:
- show bgp l2vpn evpn summary
- show bgp l2vpn evpn vni ...
- show bgp l2vpn evpn route ...
- show bgp l2vpn evpn route vni ...
- show bgp l2vpn evpn import-rt

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-08-08 10:09:36 -04:00
Renato Westphal
163076686e bgpd/ospfd: fix json leaks and blank output
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-26 12:28:56 -03: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
Donald Sharp
1ea6b3f237 Merge remote-tracking branch 'origin/master' into evpn_plus_struct_attr 2017-07-14 08:24:46 -04:00
Donald Sharp
8c19712819 bgpd: Disable new EVPN CLI
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-14 08:08:52 -04:00
David Lamparter
61b7d449bd *: remove VTYNL, part 3 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:03 +02:00
David Lamparter
181039f3d7 *: ditch vty_outln(), part 2 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:19:58 +02:00
David Lamparter
5c7571d43f *: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13 20:29:22 +02:00
vivek
90e60aa7c9 bgpd: Additional configuration for EVPN
Implement configuration options for EVPN. The configuration options include
VNI configuration with RD and Import and Export Route Targets. Also, display
the EVPN configuration.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-12 15:07:27 -04:00
vivek
520d5d768b bgpd: Display (show) commands for EVPN
Implement various operational/display commands for EVPN:
- show bgp evpn summary
- show bgp evpn vni [<vni>]
- show bgp evpn route [type <macip|multicast>]
- show bgp evpn route [rd <rd> [type <macip|multicast>]]
- show bgp evpn route [rd <rd> [mac <mac> [ip <ip>]]]
- show bgp evpn route vni <vni> [type <macip|multicast> | vtep <ip>]
- show bgp evpn route vni <vni> [mac <mac> [ip <ip>]]]
- show bgp evpn route vni <vni> [multicast <ip>]
- show bgp evpn route vni all [vtep <ip>]
- show bgp evpn import-rt

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
2017-07-12 15:04:41 -04:00
vivek
128ea8abbd bgpd: EVPN route handling
Core EVPN route handling functionality. This includes support for the
following:
- interface with zebra to learn about local VNIs and MACIPs as well as
to install remote VTEPs (per VNI) and remote MACIPs
- create/update/delete EVPN type-2 and type-3 routes
- attribute creation, route selection and install
- route handling per VNI and for the global routing table
- parsing of received EVPN routes and handling by route type
- encoding attributes for EVPN routes and EVPN prefix creation (for
Updates)

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Daniel Walton <dwalton@cumulusnetworks.com>
2017-07-12 14:36:46 -04:00
vivek
7724c0a1a7 bgpd: Implement EVPN enable/disable
Implement the command 'advertise-all-vni' under the EVPN address-family
in order to allow the local system to learn about local VNIs (and MACs
and Neighbors corresponding to those VNIs) and exchange with other EVPN
speakers.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:   Dinesh Dutt <ddutt@cumulusnetworks.com>
2017-07-12 12:36:35 -04:00
Quentin Young
1318e7c841 *: s/VTY_NEWLINE/VTYNL/g
Should be able to fit more vty_out onto one line now

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:54 +00:00
Quentin Young
96ade3ed77 *: use vty_outln
Saves 400 lines

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:31:28 +00:00
David Lamparter
e2f30ad1c2 Merge branch 'frr/pull/569'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-18 12:34:34 +02:00
Lou Berger
201c3dac29 bgpd: fix config of v6 vpn networks tags
Signed-off-by: Lou Berger <lberger@labn.net>
2017-05-17 14:56:43 -04:00
David Lamparter
896014f4bc *: make consistent & update GPLv2 file headers
The FSF's address changed, and we had a mixture of comment styles for
the GPL file header.  (The style with * at the beginning won out with
580 to 141 in existing files.)

Note: I've intentionally left intact other "variations" of the copyright
header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-15 16:37:41 +02:00
Renato Westphal
313605cb92 *: fix a bunch of segfaults detected by a CLI fuzzer
This patch fixes the following segfaults:
zebra aborted: vtysh -c "show ipv6 mroute"
zebra aborted: vtysh -c "configure terminal" -c "debug zebra kernel msgdump"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no packet-loss"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no metric"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no ava-bw"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no res-bw"
zebra aborted: vtysh -c "configure terminal" -c "interface eth99" -c "link-params" -c "no use-bw"
ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "area 1.1.1.1 nssa"
ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "area 4294967295 nssa"
pimd aborted: vtysh -c "show ip msdp sa 1.1.1.1"
pimd aborted: vtysh -c "configure terminal" -c "ip ssmpingd"
pimd aborted: vtysh -c "configure terminal" -c "no ip ssmpingd"
pimd aborted: vtysh -c "configure terminal" -c "no ip msdp mesh-group WORD source"
pimd aborted: vtysh -c "configure terminal" -c "interface eth99" -c "ip pim hello 180"
bgpd aborted: vtysh -c "show bgp l2vpn evpn rd 1:1"
bgpd aborted: vtysh -c "clear vnc nve un *"
bgpd aborted: vtysh -c "clear vnc nve un 1.1.1.1"
bgpd aborted: vtysh -c "clear vnc nve un 2001:db8::1"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 cost 255 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1 cost 255"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 1.1.1.1"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 cost 255 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1 cost 255"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 1.1.1.1 un 2001:db8::1"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 cost 255 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1 cost 255"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 1.1.1.1"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 cost 255 lifetime 4294967295"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1 cost 255"
bgpd aborted: vtysh -c "add vnc mac 11:11:11:11:11:11 virtual-network-identifier 4294967295 vn 2001:db8::1 un 2001:db8::1"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp ipv4 prefix-list NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp ipv6 prefix-list NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export bgp route-map NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra ipv4 prefix-list NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra ipv6 prefix-list NAME"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp 1" -c "no vnc export zebra route-map NAME"
bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "no set ipv6 vpn next-hop"
bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "set vpnv4 next-hop"
bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "set vpnv6 next-hop"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "address-family ipv6 vpn" -c "network 2001:db8::1/128 rd 1:1 tag WORD"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "address-family vpnv6 unicast" -c "network 2001:db8::1/128 rd 1:1 tag WORD"
bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "no neighbor WORD shutdown message MSG..."
bgpd aborted: vtysh -c "configure terminal" -c "router bgp" -c "neighbor WORD shutdown message MSG..."

More to come later.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-05-04 14:39:58 -03:00
Donald Sharp
5288483719 *: Clean up some wrong references
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-04 20:18:24 -04:00
Donald Sharp
55daa60593 bgpd: Fix help strings for new command
Fix the help strings to be correct.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-24 15:08:48 -05:00
Philippe Guibert
4d0e6ece4b bgpd: indent new evpn code to the frr standards
Using intent tool, and apply to all bgp_evpn files.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-02-14 13:58:59 +01:00
Philippe Guibert
3da6fcd557 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>
2017-02-14 13:58:59 +01:00
Philippe Guibert
4c63a661e3 bgpd: vty commands added for EVPN address family
Enhancement of the following show vty evpn commands:

show bgp l2vpn evpn all A.B.C.D

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2017-02-14 13:58:59 +01:00
Philippe Guibert
784d3a4299 bgpd: enhance EPVN vty show commands
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>
2017-02-14 13:58:58 +01:00