summaryrefslogtreecommitdiffstats
path: root/doc/user/vnc.rst
blob: 4ff27c6a630d4f1fd9171b866618ac56e4108cac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
.. _vnc-and-vnc-gw:

**************
VNC and VNC-GW
**************

This chapter describes how to use :abbr:`VNC (Virtual Network Control)`
services, including :abbr:`NVA (Network Virtualization Authority)` and
:abbr:`VNC-GW (VNC Gateway)` functions. Background information on NVAs,
:abbr:`NVE (Network Virtualization Edge)` s, :abbr:`UN (Underlay Network)` s,
and :abbr:`VN (Virtual Network)` is available from the
`IETF <https://datatracker.ietf.org/wg/nvo3>`_. :abbr:`VNC-GW (VNC Gateway)` s
support the import/export of routing information between VNC and :abbr:`CE
(customer edge)` routers operating within a VN.  Both IP/Layer 3 (L3) VNs, and
IP with Ethernet/Layer 2 (L2) VNs are supported.

BGP, with IP VPNs and Tunnel Encapsulation, is used to distribute VN
information between NVAs. BGP based IP VPN support is defined in :rfc:`4364`,
and :rfc:`4659`. Encapsulation information is provided via the Tunnel
Encapsulation Attribute, :rfc:`5512`.

The protocol that is 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. Specific RFP
implementations may choose to implement either a `hard-state` or `soft-state`
prefix and address registration model. To support a `soft-state` refresh model,
a `lifetime` in seconds is associated with all registrations and responses.

The chapter also provides sample configurations for basic example scenarios.

.. _configuring-vnc:

Configuring VNC
===============

Virtual Network Control (:abbr:`VNC`) service configuration commands appear in
the `router bgp` section of the BGPD configuration file
(:ref:`bgp-configuration-examples`). The commands are broken down into the
following areas:

- :dfn:`General VNC` configuration applies to general VNC operation and is
  primarily used to control the method used to advertise tunnel information.

- :dfn:`Remote Forwarder Protocol (RFP)` configuration relates to the protocol
  used between NVAs and NVEs.

- :dfn:`VNC Defaults` provides default parameters for registered NVEs.

- :dfn:`VNC NVE Group` provides for configuration of a specific set of
  registered NVEs and overrides default parameters.

- :dfn:`Redistribution` and :dfn:`Export` control VNC-GW operation, i.e., the
  import/export of routing information between VNC and customer edge routers
  (:abbr:`CE` s) operating within a VN.


.. _general-vnc-configuration:

General VNC Configuration
-------------------------

.. _rfp-related-configuration:

RFP Related Configuration
-------------------------

The protocol that is used to communicate routing and Ethernet / L2 forwarding
information between NVAs and NVEs is referred to as the Remote Forwarder
Protocol (RFP). Currently, only a simple example RFP is included in FRR.
Developers may use this example as a starting point to integrate FRR with an
RFP of their choosing, e.g., `OpenFlow`. The example code includes the
following sample configuration:

.. clicmd:: rfp example-config-value VALUE

This is a simple example configuration parameter included as part of the RFP
example code. VALUE must be in the range of 0 to 4294967295.

.. _vnc-defaults-configuration:

VNC Defaults Configuration
--------------------------

The VNC Defaults section allows the user to specify default values for
configuration parameters for all registered NVEs.
Default values are overridden by :ref:`vnc-nve-group-configuration`.

.. clicmd:: vnc defaults

Enter VNC configuration mode for specifying VNC default behaviors. Use
`exit-vnc` to leave VNC configuration mode. `vnc defaults` is optional.

.. code-block:: frr

   vnc defaults
   ... various VNC defaults
   exit-vnc


These are the statements that can appear between ``vnc defaults`` and
``exit-vnc``. Documentation for these statements is given in
:ref:`vnc-nve-group-configuration`.

- :clicmd:`rt import RT-LIST`
- :clicmd:`rt export RT-LIST`
- :clicmd:`rt both RT-LIST`
- :clicmd:`rd ROUTE-DISTINGUISHER`
- :clicmd:`l2rd NVE-ID-VALUE`
- :clicmd:`response-lifetime LIFETIME|infinite`
- :clicmd:`export bgp|zebra route-map MAP-NAME`
- :clicmd:`export bgp|zebra no route-map`

.. clicmd:: exit-vnc

   Exit VNC configuration mode.

.. _vnc-nve-group-configuration:

VNC NVE Group Configuration
---------------------------

A NVE Group corresponds to a specific set of NVEs. A Client NVE is
assigned to an NVE Group based on whether there is a match for either
its virtual or underlay network address against the VN and/or UN address
prefixes specified in the NVE Group definition. When an NVE Group
definition specifies both VN and UN address prefixes, then an NVE must
match both prefixes in order to be assigned to the NVE Group. In the
event that multiple NVE Groups match based on VN and/or UN addresses,
the NVE is assigned to the first NVE Group listed in the configuration.
If an NVE is not assigned to an NVE Group, its messages will be ignored.

Configuration values specified for an NVE group apply to all
member NVEs and override configuration values specified in the VNC
Defaults section.

**At least one `nve-group` is mandatory for useful VNC operation.**

.. clicmd:: vnc nve-group NAME

  Enter VNC configuration mode for defining the NVE group `name`.
  Use `exit` or `exit-vnc` to exit group configuration mode.

  .. code-block:: frr

     vnc nve-group group1
     ... configuration commands
     exit-vnc


The following statements are valid in an NVE group definition:

.. clicmd:: l2rd NVE-ID-VALUE

   Set the value used to distinguish NVEs connected to the same physical
   Ethernet segment (i.e., at the same location) [#]_.

   The nve-id subfield may be specified as either a literal value in the range
   1-255, or it may be specified as `auto:vn`, which means to use the
   least-significant octet of the originating NVE's VN address.

.. clicmd:: prefix vn|un A.B.C.D/M|X:X::X:X/M

   Specify the matching prefix for this NVE group by either virtual-network
   address (`vn`) or underlay-network address (`un`). Either or both
   virtual-network and underlay-network prefixes may be specified. Subsequent
   virtual-network or underlay-network values within a `vnc nve-group`
   `exit-vnc` block override their respective previous values.

   These prefixes are used only for determining assignments of NVEs to NVE
   Groups.

.. clicmd:: rd ROUTE-DISTINGUISHER

   Specify the route distinguisher for routes advertised via BGP
   VPNs. The route distinguisher must be in one of these forms:

   - ``IPv4-address:two-byte-integer``
   - ``four-byte-autonomous-system-number:two-byte-integer``
   - ``two-byte-autonomous-system-number:four-byte-integer``
   - ``auto:vn:two-byte-integer``

   Routes originated by NVEs in the NVE group will use the group's specified
   `route-distinguisher` when they are advertised via BGP.  If the `auto` form
   is specified, it means that a matching NVE has its RD set to
   ``rd_type=IP=1:IPv4-address=VN-address:two-byte-integer``, for IPv4 VN
   addresses and
   ``rd_type=IP=1:IPv4-address=Last-four-bytes-of-VN-address:two-byte-integer``,
   for IPv6 VN addresses.

   If the NVE group definition does not specify a `route-distinguisher`, then
   the default `route-distinguisher` is used.  If neither a group nor a default
   `route-distinguisher` is configured, then the advertised RD is set to
   ``two-byte-autonomous-system-number=0:four-byte-integer=0``.

.. clicmd:: response-lifetime LIFETIME|infinite

   Specify the response lifetime, in seconds, to be included in RFP response
   messages sent to NVEs. If the value 'infinite' is given, an infinite
   lifetime will be used.

   Note that this parameter is not the same as the lifetime supplied by NVEs in
   RFP registration messages. This parameter does not affect the lifetime value
   attached to routes sent by this server via BGP.

   If the NVE group definition does not specify a `response-lifetime`, the
   default `response-lifetime` will be used.  If neither a group nor a default
   `response-lifetime` is configured, the value 3600 will be used. The maximum
   response lifetime is 2147483647.

.. clicmd:: rt export RT-LIST

.. clicmd:: rt import RT-LIST

.. clicmd:: rt both RT-LIST

   Specify route target import and export lists. `rt-list` is a
   space-separated list of route targets, each element of which is
   in one of the following forms:

   - ``IPv4-address:two-byte-integer``
   - ``four-byte-autonomous-system-number:two-byte-integer``
   - ``two-byte-autonomous-system-number:four-byte-integer``

   The first form, `rt export`, specifies an `export rt-list`.  The `export
   rt-list` will be attached to routes originated by NVEs in the NVE group
   when they are advertised via BGP.  If the NVE group definition does not
   specify an `export rt-list`, then the default `export rt-list` is used.
   If neither a group nor a default `export rt-list` is configured, then no
   RT list will be sent; in turn, these routes will probably not be
   processed by receiving NVAs.

   The second form, `rt import` specifies an `import rt-list`, which is a
   filter for incoming routes.  In order to be made available to NVEs in the
   group, incoming BGP VPN routes must have RT lists that have at least one
   route target in common with the group's `import rt-list`.

   If the NVE group definition does not specify an import filter, then the
   default `import rt-list` is used.  If neither a group nor a default
   `import rt-list` is configured, there can be no RT intersections when
   receiving BGP routes and therefore no incoming BGP routes will be
   processed for the group.

   The third, `rt both`, is a shorthand way of specifying both lists
   simultaneously, and is equivalent to `rt export `rt-list`` followed by
   `rt import `rt-list``.

.. clicmd:: export bgp|zebra route-map MAP-NAME

   Specify that the named route-map should be applied to routes being exported
   to bgp or zebra.  This parameter is used in conjunction with
   :ref:`configuring-export-of-routes-to-other-routing-protocols`.  This item
   is optional.

.. clicmd:: export bgp|zebra no route-map

   Specify that no route-map should be applied to routes being exported to bgp
   or zebra.  This parameter is used in conjunction with
   :ref:`configuring-export-of-routes-to-other-routing-protocols`.  This item
   is optional.

.. clicmd:: export bgp|zebra ipv4|ipv6 prefix-list LIST-NAME

   Specify that the named prefix-list filter should be applied to routes being
   exported to bgp or zebra. Prefix-lists for ipv4 and ipv6 are independent of
   each other. This parameter is used in conjunction with
   :ref:`configuring-export-of-routes-to-other-routing-protocols`.  This item
   is optional.

.. clicmd:: export bgp|zebra no ipv4|ipv6 prefix-list

   Specify that no prefix-list filter should be applied to routes being
   exported to bgp or zebra. This parameter is used in conjunction with
   :ref:`configuring-export-of-routes-to-other-routing-protocols`.  This item
   is optional.

.. _vnc-l2-group-configuration:

VNC L2 Group Configuration
--------------------------

The route targets advertised with prefixes and addresses registered by an NVE
are determined based on the NVE's associated VNC NVE Group Configuration,
:ref:`vnc-nve-group-configuration`. Layer 2 (L2) Groups are used to override
the route targets for an NVE's Ethernet registrations based on the Logical
Network Identifier and label value.  A Logical Network Identifier is used to
uniquely identify a logical Ethernet segment and is conceptually similar to the
Ethernet Segment Identifier defined in :rfc:`7432`. Both the Logical Network
Identifier and Label are passed to VNC via RFP prefix and address registration.

Note that a corresponding NVE group configuration must be present, and that
other NVE associated configuration information, notably RD, is not impacted by
L2 Group Configuration.

.. clicmd:: vnc l2-group NAME

   Enter VNC configuration mode for defining the L2 group `name`.
   Use `exit` or `exit-vnc` to exit group configuration mode.

   .. code-block:: frr

       vnc l2-group group1
         ... configuration commands
       exit-vnc



   Delete the L2 group named `name`.

The following statements are valid in a L2 group definition:

.. clicmd:: logical-network-id VALUE

   Define the Logical Network Identifier with a value in the range of
   0-4294967295 that identifies the logical Ethernet segment.

.. clicmd:: labels LABEL-LIST


   Add or remove labels associated with the group. `label-list` is a
   space separated list of label values in the range of 0-1048575.

.. clicmd:: rt import RT-TARGET

.. clicmd:: rt export RT-TARGET

.. clicmd:: rt both RT-TARGET

   Specify the route target import and export value associated with the group.
   A complete definition of these parameters is given above,
   :ref:`vnc-nve-group-configuration`.

.. _configuring-redistribution-of-routes-from-other-routing-protocols:

Configuring Redistribution of Routes from Other Routing Protocols
-----------------------------------------------------------------

Routes from other protocols (including BGP) can be provided to VNC (both for
RFP and for redistribution via BGP) from three sources: the zebra kernel
routing process; directly from the main (default) unicast BGP RIB; or directly
from a designated BGP unicast exterior routing RIB instance.

The protocol named in the `vnc redistribute` command indicates the route
source: `bgp-direct` routes come directly from the main (default) unicast BGP
RIB and are available for RFP and are redistributed via BGP;
`bgp-direct-to-nve-groups` routes come directly from a designated BGP unicast
routing RIB and are made available only to RFP; and routes from other protocols
come from the zebra kernel routing process.
Note that the zebra process does not need to be active if
only `bgp-direct` or `bgp-direct-to-nve-groups` routes are used.

zebra routes
^^^^^^^^^^^^

Routes originating from protocols other than BGP must be obtained
via the zebra routing process.
Redistribution of these routes into VNC does not support policy mechanisms
such as prefix-lists or route-maps.

bgp-direct routes
^^^^^^^^^^^^^^^^^

`bgp-direct` redistribution supports policy via
prefix lists and route-maps. This policy is applied to incoming
original unicast routes before the redistribution translations
(described below) are performed.

Redistribution of `bgp-direct` routes is performed in one of three
possible modes: `plain`, `nve-group`, or `resolve-nve`.
The default mode is `plain`.
These modes indicate the kind of translations applied to routes before
they are added to the VNC RIB.

In `plain` mode, the route's next hop is unchanged and the RD is set
based on the next hop.
For `bgp-direct` redistribution, the following translations are performed:

- The VN address is set to the original unicast route's next hop address.
- The UN address is NOT set. (VN->UN mapping will occur via
  ENCAP route or attribute, based on `vnc advertise-un-method`
  setting, generated by the RFP registration of the actual NVE)
- The RD is set to as if auto:vn:0 were specified (i.e.,
  `rd_type=IP=1`:`IPv4-address=VN-address`:`two-byte-integer=0`)
- The RT list is included in the extended community list copied from the
  original unicast route (i.e., it must be set in the original unicast route).

In `nve-group` mode, routes are registered with VNC as if they came from an NVE
in the nve-group designated in the `vnc redistribute nve-group` command. The
following translations are performed:

- The next hop/VN address is set to the VN prefix configured for the
  redistribute nve-group.
- The UN address is set to the UN prefix configured for the redistribute
  nve-group.
- The RD is set to the RD configured for the redistribute nve-group.
- The RT list is set to the RT list configured for the redistribute nve-group.
  If `bgp-direct` routes are being redistributed, any extended communities
  present in the original unicast route will also be included.

In `resolve-nve` mode, the next hop of the original BGP route is typically the
address of an NVE connected router (CE) connected by one or more NVEs.
Each of the connected NVEs will register, via RFP, a VNC host route to the CE.
This mode may be though of as a mechanism to proxy RFP registrations of BGP
unicast routes on behalf of registering NVEs.

Multiple copies of the BGP route, one per matching NVE host route, will be
added to VNC.  In other words, for a given BGP unicast route, each instance of
a RFP-registered host route to the unicast route's next hop will result in an
instance of an imported VNC route.  Each such imported VNC route will have a
prefix equal to the original BGP unicast route's prefix, and a next hop equal
to the next hop of the matching RFP-registered host route.  If there is no
RFP-registered host route to the next hop of the BGP unicast route, no
corresponding VNC route will be imported.

The following translations are applied:

- The Next Hop is set to the next hop of the NVE route (i.e., the
  VN address of the NVE).

- The extended community list in the new route is set to the
  union of:

- Any extended communities in the original BGP route

  - Any extended communities in the NVE route
  - An added route-origin extended community with the next hop of the
    original BGP route
    is added to the new route.
    The value of the local administrator field defaults 5226 but may
    be configured by the user via the `roo-ec-local-admin` parameter.

- The Tunnel Encapsulation attribute is set to the value of the Tunnel
  Encapsulation attribute of the NVE route, if any.


bgp-direct-to-nve-groups routes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Unicast routes from the main or a designated instance of BGP may be
redistributed to VNC as bgp-direct-to-nve-groups routes. These routes are NOT
announced via BGP, but they are made available for local RFP lookup in response
to queries from NVEs.

A non-main/default BGP instance is configured using the
`router bgp AS view NAME` command as described elsewhere in this document.

In order for a route in the unicast BGP RIB to be made available to a querying
NVE, there must already be, available to that NVE, an (interior) VNC route
matching the next hop address of the unicast route.  When the unicast route is
provided to the NVE, its next hop is replaced by the next hop of the
corresponding NVE. If there are multiple longest-prefix-match VNC routes, the
unicast route will be replicated for each.

There is currently no policy (prefix-list or route-map) support for
`bgp-direct-to-nve-groups` routes.

Redistribution Command Syntax
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. clicmd:: vnc redistribute ipv4|ipv6 bgp|bgp-direct|ipv6 bgp-direct-to-nve-groups|connected|kernel|ospf|rip|static

.. clicmd:: vnc redistribute ipv4|ipv6 bgp-direct-to-nve-groups view VIEWNAME


   Import (or do not import) prefixes from another routing protocols. Specify
   both the address family to import (`ipv4` or `ipv6`) and the protocol
   (`bgp`, `bgp-direct`, `bgp-direct-to-nve-groups`, `connected`, `kernel`,
   `ospf`, `rip`, or `static`). Repeat this statement as needed for each
   combination of address family and routing protocol.  Prefixes from protocol
   `bgp-direct` are imported from unicast BGP in the same bgpd process.
   Prefixes from all other protocols (including `bgp`) are imported via the
   `zebra` kernel routing process.

.. clicmd:: vnc redistribute mode plain|nve-group|resolve-nve

   Redistribute routes from other protocols into VNC using the specified mode.
   Not all combinations of modes and protocols are supported.

.. clicmd:: vnc redistribute nve-group GROUP-NAME


   When using `nve-group` mode, assign (or do not assign) the NVE group
   `group-name` to routes redistributed from another routing protocol.
   `group-name` must be configured using `vnc nve-group`.

   The VN and UN prefixes of the nve-group must both be configured, and each
   prefix must be specified as a full-length (/32 for IPv4, /128 for IPv6)
   prefix.

.. clicmd:: vnc redistribute lifetime LIFETIME|infinite

   Assign a registration lifetime, either `lifetime` seconds or `infinite`, to
   prefixes redistributed from other routing protocols as if they had been
   received via RFP registration messages from an NVE. `lifetime` can be any
   integer between 1 and 4294967295, inclusive.

.. clicmd:: vnc redistribute resolve-nve roo-ec-local-admin 0-65536

   Assign a value to the local-administrator subfield used in the
   Route Origin extended community that is assigned to routes exported
   under the `resolve-nve` mode. The default value is `5226`.

The following four `prefix-list` and `route-map` commands may be specified
in the context of an nve-group or not.  If they are specified in the context
of an nve-group, they apply only if the redistribution mode is `nve-group`,
and then only for routes being redistributed from `bgp-direct`.  If they are
specified outside the context of an nve-group, then they apply only for
redistribution modes `plain` and `resolve-nve`, and then only for routes
being redistributed from `bgp-direct`.

.. clicmd:: vnc redistribute bgp-direct (ipv4|ipv6) prefix-list LIST-NAME

   When redistributing `bgp-direct` routes,
   specifies that the named prefix-list should be applied.

.. clicmd:: vnc redistribute bgp-direct no (ipv4|ipv6) prefix-list

   When redistributing `bgp-direct` routes,
   specifies that no prefix-list should be applied.

.. clicmd:: vnc redistribute bgp-direct route-map  MAP-NAME

   When redistributing `bgp-direct` routes,
   specifies that the named route-map should be applied.

.. clicmd:: vnc redistribute bgp-direct no route-map

   When redistributing `bgp-direct` routes,
   specifies that no route-map should be applied.

.. _configuring-export-of-routes-to-other-routing-protocols:

Configuring Export of Routes to Other Routing Protocols
-------------------------------------------------------

Routes from VNC (both for RFP and for redistribution via BGP) can be provided
to other protocols, either via zebra or directly to BGP.

It is important to note that when exporting routes to other protocols, the
downstream protocol must also be configured to import the routes.  For example,
when VNC routes are exported to unicast BGP, the BGP configuration must include
a corresponding `redistribute vnc-direct` statement.

.. clicmd:: export bgp|zebra mode none|group-nve|registering-nve|ce

   Specify how routes should be exported to bgp or zebra.  If the mode is
   `none`, routes are not exported.  If the mode is `group-nve`, routes are
   exported according to nve-group or vrf-policy group configuration
   (:ref:`vnc-nve-group-configuration`): if a group is configured to allow
   export, then each prefix visible to the group is exported with next hops set
   to the currently-registered NVEs.  If the mode is `registering-nve`, then all
   VNC routes are exported with their original next hops.  If the mode is `ce`,
   only VNC routes that have an NVE connected CE Router encoded in a Route
   Origin Extended Community are exported.  This extended community must have an
   administrative value that matches the configured `roo-ec-local-admin` value.
   The next hop of the exported route is set to the encoded NVE connected CE
   Router.

   The default for both bgp and zebra is mode `none`.

.. clicmd:: vnc export bgp|zebra group-nve group GROUP-NAME

.. clicmd:: vnc export bgp|zebra group-nve no group GROUP-NAME

   When export mode is `group-nve`, export (or do not export) prefixes from the
   specified nve-group or vrf-policy group to unicast BGP or to zebra.  Repeat
   this statement as needed for each nve-group to be exported.  Each VNC prefix
   that is exported will result in N exported routes to the prefix, each with a
   next hop corresponding to one of the N NVEs currently associated with the
   nve-group.

Some commands have a special meaning under certain export modes.

:clicmd:`export bgp|zebra ipv4|ipv6 prefix-list LIST-NAME`
   When export mode is `ce` or `registering-nve`,
   specifies that the named prefix-list should be applied to routes
   being exported to bgp or zebra.
   Prefix-lists for ipv4 and ipv6 are independent of each other.

:clicmd:`export bgp|zebra no ipv4|ipv6 prefix-list`
   When export mode is `ce` or `registering-nve`,
   specifies that no prefix-list should be applied to routes
   being exported to bgp or zebra.

:clicmd:`export bgp|zebra route-map MAP-NAME`
   When export mode is `ce` or `registering-nve`, specifies that the named
   route-map should be applied to routes being exported to bgp or zebra.

:clicmd:`export bgp|zebra no route-map`
   When export mode is `ce` or `registering-nve`, specifies that no route-map
   should be applied to routes being exported to bgp or zebra.

   When the export mode is `group-nve`, policy for exported routes is specified
   per-NVE-group or vrf-policy group inside a `nve-group` `RFG-NAME` block via
   the following commands(:ref:`vnc-nve-group-configuration`):

:clicmd:`export bgp|zebra route-map MAP-NAME`
   This command is valid inside a `nve-group` `RFG-NAME` block.  It specifies
   that the named route-map should be applied to routes being exported to bgp
   or zebra.

:clicmd:`export bgp|zebra no route-map`
   This command is valid inside a `nve-group` `RFG-NAME` block.  It specifies
   that no route-map should be applied to routes being exported to bgp or
   zebra.

:clicmd:`export bgp|zebra ipv4|ipv6 prefix-list LIST-NAME`
   This command is valid inside a `nve-group` `RFG-NAME` block.  It specifies
   that the named prefix-list filter should be applied to routes being exported
   to bgp or zebra.  Prefix-lists for ipv4 and ipv6 are independent of each
   other.

:clicmd:`export bgp|zebra no ipv4|ipv6 prefix-list`
   This command is valid inside a `nve-group` `RFG-NAME` block.  It specifies
   that no prefix-list filter should be applied to routes being exported to
   bgp or zebra.

.. _manual-address-control:

Manual Address Control
======================

The commands in this section can be used to augment normal dynamic VNC.  The
`add vnc` commands can be used to manually add IP prefix or Ethernet MAC
address forwarding information. The `clear vnc` commands can be used to remove
manually and dynamically added information.

.. clicmd:: add vnc prefix (A.B.C.D/M|X:X::X:X/M) vn (A.B.C.D|X:X::X:X) un (A.B.C.D|X:X::X:X) [cost (0-255)] [lifetime (infinite|(1-4294967295))] [local-next-hop (A.B.C.D|X:X::X:X) [local-cost (0-255)]]

   Register an IP prefix on behalf of the NVE identified by the VN and UN
   addresses. The `cost` parameter provides the administrative preference of
   the forwarding information for remote advertisement. If omitted, it defaults
   to 255 (lowest preference). The `lifetime` parameter identifies the period,
   in seconds, that the information remains valid. If omitted, it defaults to
   `infinite`. The optional `local-next-hop` parameter is used to configure a
   nexthop to be used by an NVE to reach the prefix via a locally connected CE
   router. This information remains local to the NVA, i.e., not passed to other
   NVAs, and is only passed to registered NVEs. When specified, it is also
   possible to provide a `local-cost` parameter to provide a forwarding
   preference. If omitted, it defaults to 255 (lowest preference).

.. clicmd:: add vnc mac xx:xx:xx:xx:xx:xx virtual-network-identifier (1-4294967295) vn (A.B.C.D|X:X::X:X) un (A.B.C.D|X:X::X:X) [prefix (A.B.C.D/M|X:X::X:X/M)] [cost (0-255)] [lifetime (infinite|(1-4294967295))]

   Register a MAC address for a logical Ethernet (L2VPN) on behalf of the NVE
   identified by the VN and UN addresses. The optional `prefix` parameter is to
   support enable IP address mediation for the given prefix. The `cost`
   parameter provides the administrative preference of the forwarding
   information. If omitted, it defaults to 255. The `lifetime` parameter
   identifies the period, in seconds, that the information remains valid. If
   omitted, it defaults to `infinite`.

.. clicmd:: clear vnc prefix (\*|A.B.C.D/M|X:X::X:X/M) (\*|[(vn|un) (A.B.C.D|X:X::X:X|\*) [(un|vn) (A.B.C.D|X:X::X:X|\*)] [mac xx:xx:xx:xx:xx:xx] [local-next-hop (A.B.C.D|X:X::X:X)])

   Delete the information identified by prefix, VN address, and UN address.
   Any or all of these parameters may be wildcarded to (potentially) match more
   than one registration. The optional `mac` parameter specifies a layer-2 MAC
   address that must match the registration(s) to be deleted. The optional
   `local-next-hop` parameter is used to delete specific local nexthop
   information.

.. clicmd:: clear vnc mac (\*|xx:xx:xx:xx:xx:xx) virtual-network-identifier (\*|(1-4294967295)) (\*|[(vn|un) (A.B.C.D|X:X::X:X|\*) [(un|vn) (A.B.C.D|X:X::X:X|\*)] [prefix (\*|A.B.C.D/M|X:X::X:X/M)])

   Delete mac forwarding information. Any or all of these parameters may be
   wildcarded to (potentially) match more than one registration. The default
   value for the `prefix` parameter is the wildcard value `*`.

.. clicmd:: clear vnc nve (\*|((vn|un) (A.B.C.D|X:X::X:X) [(un|vn) (A.B.C.D|X:X::X:X)]))

   Delete prefixes associated with the NVE specified by the given VN and UN
   addresses. It is permissible to specify only one of VN or UN, in which case
   any matching registration will be deleted. It is also permissible to specify
   `*` in lieu of any VN or UN address, in which case all registrations will
   match.

.. _other-vnc-related-commands:

Other VNC-Related Commands
==========================

Note: VNC-Related configuration can be obtained via the `show
running-configuration` command when in `enable` mode.

The following commands are used to clear and display Virtual Network Control
related information:

.. clicmd:: clear vnc counters

   Reset the counter values stored by the NVA. Counter
   values can be seen using the `show vnc` commands listed above. This
   command is only available in `enable` mode.

.. clicmd:: show vnc summary

   Print counter values and other general information
   about the NVA. Counter values can be reset
   using the `clear vnc counters` command listed below.

.. clicmd:: show vnc nves

.. clicmd:: show vnc nves vn|un ADDRESS

   Display the NVA's current clients. Specifying `address` limits the output to
   the NVEs whose addresses match `address`. The time since the NVA last
   communicated with the NVE, per-NVE summary counters and each NVE's addresses
   will be displayed.

.. clicmd:: show vnc queries

.. clicmd:: show vnc queries PREFIX

   Display active Query information. Queries remain valid for the default
   Response Lifetime (:ref:`vnc-defaults-configuration`) or NVE-group Response
   Lifetime (:ref:`vnc-nve-group-configuration`). Specifying `prefix` limits
   the output to Query Targets that fall within `prefix`.

   Query information is provided for each querying NVE, and includes the Query
   Target and the time remaining before the information is removed.

.. clicmd:: show vnc registrations [all|local|remote|holddown|imported]

.. clicmd:: show vnc registrations [all|local|remote|holddown|imported] PREFIX

   Display local, remote, holddown, and/or imported registration information.
   Local registrations are routes received via RFP, which are present in the
   NVA Registrations Cache. Remote registrations are routes received via BGP
   (VPN SAFIs), which are present in the NVE-group import tables. Holddown
   registrations are local and remote routes that have been withdrawn but whose
   holddown timeouts have not yet elapsed. Imported information represents
   routes that are imported into NVA and are made available to querying NVEs.
   Depending on configuration, imported routes may also be advertised via BGP.
   Specifying `prefix` limits the output to the registered prefixes that fall
   within `prefix`.

   Registration information includes the registered prefix, the registering NVE
   addresses, the registered administrative cost, the registration lifetime and
   the time since the information was registered or, in the case of Holddown
   registrations, the amount of time remaining before the information is
   removed.

.. clicmd:: show vnc responses [active|removed]

.. clicmd:: show vnc responses [active|removed] PREFIX

   Display all, active and/or removed response information which are
   present in the NVA Responses Cache. Responses remain valid for the
   default Response Lifetime (:ref:`vnc-defaults-configuration`) or
   NVE-group Response Lifetime (:ref:`vnc-nve-group-configuration`.)
   When Removal Responses are enabled (:ref:`general-vnc-configuration`),
   such responses are listed for the Response Lifetime. Specifying
   `prefix` limits the output to the addresses that fall within
   `prefix`.

   Response information is provided for each querying NVE, and includes
   the response prefix, the prefix-associated registering NVE addresses,
   the administrative cost, the provided response lifetime and the time
   remaining before the information is to be removed or will become inactive.

.. clicmd:: show memory vnc

   Print the number of memory items allocated by the NVA.

.. _example-vnc-and-vnc-gw-configurations:

Example VNC and VNC-GW Configurations
=====================================

.. _vnc-mesh-nva-config:

Mesh NVA Configuration
----------------------

This example includes three NVAs, nine NVEs, and two NVE groups. Note that
while not shown, a single physical device may support multiple logical NVEs.
:ref:`vnc-fig-vnc-mesh` shows ``code NVA-1`` (192.168.1.100), ``NVA 2``
(192.168.1.101), and ``NVA 3`` (192.168.1.102), which are connected in a full
mesh. Each is a member of the autonomous system 64512. Each NVA provides VNC
services to three NVE clients in the 172.16.0.0/16 virtual-network address
range. The 172.16.0.0/16 address range is partitioned into two NVE groups,
``group1`` (172.16.0.0/17) and ``group2`` (172.16.128.0/17).

Each NVE belongs to either NVE group ``group1`` or NVE group ``group2``.  The
NVEs ``NVE 1``, ``NVE 2``, ``NVE 4``, ``NVE 7``, and ``NVE 8`` are members of
the NVE group ``group1``.  The NVEs ``NVE 3``, ``NVE 5``, ``NVE 6``, and ``NVE
9`` are members of the NVE group ``group2``.

Each NVA advertises NVE underlay-network IP addresses using the
Tunnel Encapsulation Attribute.

.. _vnc-fig-vnc-mesh:

.. figure:: ../figures/fig-vnc-mesh.png
   :align: center
   :alt: Three-way Mesh

   A three-way full mesh with three NVEs per NVA.

:file:`bgpd.conf` for ``NVA 1`` (192.168.1.100):

.. code-block:: frr

   router bgp 64512

       bgp router-id 192.168.1.100

       neighbor 192.168.1.101  remote-as 64512
       neighbor 192.168.1.102  remote-as 64512

       address-family ipv4 vpn
           neighbor 192.168.1.101 activate
           neighbor 192.168.1.102 activate
       exit-address-family

       vnc defaults
           rd 64512:1
           response-lifetime 200
           rt both 1000:1 1000:2
       exit-vnc

       vnc nve-group group1
           prefix vn 172.16.0.0/17
           rt both 1000:1
       exit-vnc

       vnc nve-group group2
           prefix vn 172.16.128.0/17
           rt both 1000:2
       exit-vnc

   exit

:file:`bgpd.conf` for ``NVA 2`` (192.168.1.101):

.. code-block:: frr

   router bgp 64512

       bgp router-id 192.168.1.101

       neighbor 192.168.1.100  remote-as 64512
       neighbor 192.168.1.102  remote-as 64512

       address-family ipv4 vpn
           neighbor 192.168.1.100 activate
           neighbor 192.168.1.102 activate
       exit-address-family

       vnc nve-group group1
           prefix vn 172.16.0.0/17
           rd 64512:1
           response-lifetime 200
           rt both 1000:1 1000:2
       exit-vnc
   exit

:file:`bgpd.conf` for ``NVA 3`` (192.168.1.102):

.. code-block:: frr

   router bgp 64512

       bgp router-id 192.168.1.102

       neighbor 192.168.1.101  remote-as 64512
       neighbor 192.168.1.102  remote-as 64512

       address-family ipv4 vpn
           neighbor 192.168.1.100 activate
           neighbor 192.168.1.101 activate
       exit-address-family

       vnc defaults
           rd 64512:1
           response-lifetime 200
           rt both 1000:1 1000:2
       exit-vnc

       vnc nve-group group1
           prefix vn 172.16.128.0/17
       exit-vnc
   exit


Mesh NVA and VNC-GW Configuration
---------------------------------

This example includes two NVAs, each with two associated NVEs, and two VNC-GWs,
each supporting two CE routers physically attached to the four NVEs. Note that
this example is showing a more complex configuration where VNC-GW is separated
from normal NVA functions; it is equally possible to simplify the configuration
and combine NVA and VNC-GW functions in a single FRR instance.

.. _vnc-fig-vnc-gw:
.. figure:: ../figures/fig-vnc-gw.png
   :align: center
   :alt: FRR VNC Gateway

   Meshed NVEs and VNC-GWs

As shown in :ref:`vnc-fig-vnc-gw`, NVAs and VNC-GWs are connected in a full iBGP
mesh. The VNC-GWs each have two CEs configured as route-reflector clients.
Each client provides BGP updates with unicast routes that the VNC-GW reflects
to the other client. The VNC-GW also imports these unicast routes into VPN
routes to be shared with the other VNC-GW and the two NVAs. This route
importation is controlled with the ``vnc redistribute`` statements shown in the
configuration. Similarly, registrations sent by NVEs via RFP to the NVAs are
exported by the VNC-GWs to the route-reflector clients as unicast routes. RFP
registrations exported this way have a next-hop address of the CE behind the
connected (registering) NVE. Exporting VNC routes as IPv4 unicast is enabled
with the ``vnc export`` command below.

The configuration for ``VNC-GW 1`` is shown below.

.. code-block:: frr

   router bgp 64512
    bgp router-id 192.168.1.101
    bgp cluster-id 1.2.3.4
    neighbor 192.168.1.102 remote-as 64512
    neighbor 192.168.1.103 remote-as 64512
    neighbor 192.168.1.104 remote-as 64512
    neighbor 172.16.1.2 remote-as 64512
    neighbor 172.16.2.2 remote-as 64512
    !
    address-family ipv4 unicast
     redistribute vnc-direct
     no neighbor 192.168.1.102 activate
     no neighbor 192.168.1.103 activate
     no neighbor 192.168.1.104 activate
     neighbor 172.16.1.2 route-reflector-client
     neighbor 172.16.2.2 route-reflector-client
    exit-address-family
    !
    address-family ipv4 vpn
      neighbor 192.168.1.102 activate
      neighbor 192.168.1.103 activate
      neighbor 192.168.1.104 activate
    exit-address-family
    vnc export bgp mode ce
    vnc redistribute mode resolve-nve
    vnc redistribute ipv4 bgp-direct
    exit

Note that in the VNC-GW configuration, the neighboring VNC-GW and NVAs each
have a statement disabling the IPv4 unicast address family. IPv4 unicast is on
by default and this prevents the other VNC-GW and NVAs from learning unicast
routes advertised by the route-reflector clients.

Configuration for ``NVA 2``:

.. code-block:: frr

   router bgp 64512
    bgp router-id 192.168.1.104
    neighbor 192.168.1.101 remote-as 64512
    neighbor 192.168.1.102 remote-as 64512
    neighbor 192.168.1.103 remote-as 64512
    !
    address-family ipv4 unicast
     no neighbor 192.168.1.101 activate
     no neighbor 192.168.1.102 activate
     no neighbor 192.168.1.103 activate
    exit-address-family
    !
    address-family ipv4 vpn
      neighbor 192.168.1.101 activate
      neighbor 192.168.1.102 activate
      neighbor 192.168.1.103 activate
    exit-address-family
    !
    vnc defaults
     response-lifetime 3600
     exit-vnc
    vnc nve-group nve1
     prefix vn 172.16.1.1/32
     response-lifetime 3600
     rt both 1000:1 1000:2
     exit-vnc
    vnc nve-group nve2
     prefix vn 172.16.2.1/32
     response-lifetime 3600
     rt both 1000:1 1000:2
     exit-vnc
    exit

.. TBD make this its own example:
..
.. @float Figure,fig:fig-vnc-gw-rr
.. @center @image{fig-vnc-gw-rr,400pt,,FRR VNC Gateway with RR}
.. @end float
.. An NVA can also import unicast routes from BGP without advertising the
.. imported routes as VPN routes.  Such imported routes, while not
.. distributed to other NVAs or VNC-GWs, are are available to NVEs via
.. RFP query messages sent to the NVA. @ref{fig:fig-vnc-gw-rr}
.. shows an example topology where unicast routes are imported into NVAs
.. from a Route Reflector.  (@pxref{Route Reflector} for route reflector
.. configuration details.)  The following three lines can be added to the
.. ``NVA 1`` and ``NVA 2`` configurations to import routes into VNC
.. for local VNC use:
..
.. @verbatim
..  neighbor 192.168.1.105 remote-as 64512
..  vnc redistribute mode plain
..  vnc redistribute ipv4 bgp-direct-to-nve-groups
.. @end verbatim

.. _vnc-with-frr-route-reflector-config:

VNC with FRR Route Reflector Configuration
------------------------------------------

A route reflector eliminates the need for a fully meshed NVA network by acting
as the hub between NVAs. :ref:`vnc-fig-vnc-frr-route-reflector` shows BGP
route reflector ``BGP Route Reflector 1`` (192.168.1.100) as a route reflector
for NVAs ``NVA 2``(192.168.1.101) and ``NVA 3`` (192.168.1.102).

.. _vnc-fig-vnc-frr-route-reflector:
.. figure:: ../figures/fig-vnc-frr-route-reflector.png
   :align: center
   :alt: FRR Route Reflector

   Two NVAs and a BGP Route Reflector

``NVA 2`` and ``NVA 3`` advertise NVE underlay-network IP addresses using the
Tunnel Encapsulation Attribute. ``BGP Route Reflector 1`` ``reflects''
advertisements from ``NVA 2`` to ``NVA 3`` and vice versa.

As in the example of :ref:`vnc-mesh-nva-config`, there are two NVE groups.  The
172.16.0.0/16 address range is partitioned into two NVE groups, ``group1``
(172.16.0.0/17) and ``group2`` (172.16.128.0/17).  The NVE ``NVE 4``, ``NVE
7``, and ``NVE 8`` are members of the NVE group ``group1``.  The NVEs ``NVE
5``, ``NVE 6``, and ``NVE 9`` are members of the NVE group ``group2``.

:file:`bgpd.conf` for ``BGP Route Reflector 1`` on 192.168.1.100:

.. code-block:: frr

   router bgp 64512

       bgp router-id 192.168.1.100

       neighbor 192.168.1.101 remote-as 64512
       neighbor 192.168.1.101 port 7179
       neighbor 192.168.1.101 description iBGP-client-192-168-1-101

       neighbor 192.168.1.102 remote-as 64512
       neighbor 192.168.1.102 port 7179
       neighbor 192.168.1.102 description iBGP-client-192-168-1-102

       address-family ipv4 unicast
           neighbor 192.168.1.101 route-reflector-client
           neighbor 192.168.1.102 route-reflector-client
       exit-address-family

       address-family ipv4 vpn
           neighbor 192.168.1.101 activate
           neighbor 192.168.1.102 activate

           neighbor 192.168.1.101 route-reflector-client
           neighbor 192.168.1.102 route-reflector-client
       exit-address-family

   exit

:file:`bgpd.conf` for ``NVA 2`` on 192.168.1.101:

.. code-block:: frr

   router bgp 64512

       bgp router-id 192.168.1.101

       neighbor 192.168.1.100  remote-as 64512

       address-family ipv4 vpn
           neighbor 192.168.1.100 activate
       exit-address-family

       vnc nve-group group1
           prefix vn 172.16.0.0/17
           rd 64512:1
           response-lifetime 200
           rt both 1000:1 1000:2
       exit-vnc
   exit

:file:`bgpd.conf` for ``NVA 2`` on 192.168.1.102:

.. code-block:: frr

   router bgp 64512

       bgp router-id 192.168.1.102

       neighbor 192.168.1.100  remote-as 64512

       address-family ipv4 vpn
           neighbor 192.168.1.100 activate
       exit-address-family

       vnc defaults
           rd 64512:1
           response-lifetime 200
           rt both 1000:1 1000:2
       exit-vnc

       vnc nve-group group1
           prefix vn 172.16.128.0/17
       exit-vnc
   exit

While not shown, an NVA can also be configured as a route reflector.

.. _vnc-with-commercial-route-reflector-config:

VNC with Commercial Route Reflector Configuration
-------------------------------------------------

This example is identical to :ref:`vnc-with-frr-route-reflector-config`
with the exception that the route reflector is a commercial router. Only the
VNC-relevant configuration is provided.

.. figure:: ../figures/fig-vnc-commercial-route-reflector.png
   :align: center
   :alt: Commercial Route Reflector

   Two NVAs with a commercial route reflector

:file:`bgpd.conf` for BGP route reflector ``Commercial Router`` on 192.168.1.104:::

   version 8.5R1.13;
   routing-options {
       rib inet.0 {
           static {
               route 172.16.0.0/16 next-hop 192.168.1.104;
           }
       }
       autonomous-system 64512;
       resolution {
           rib inet.3 {
               resolution-ribs inet.0;
           }
           rib bgp.l3vpn.0 {
               resolution-ribs inet.0;
           }
       }
   }
   protocols {
       bgp {
           advertise-inactive;
           family inet {
               labeled-unicast;
           }
          group 1 {
               type internal;
               advertise-inactive;
               advertise-peer-as;
               import h;
               family inet {
                   unicast;
               }
               family inet-vpn {
                   unicast;
               }
               cluster 192.168.1.104;
               neighbor 192.168.1.101;
               neighbor 192.168.1.102;
           }
       }
   }
   policy-options {
       policy-statement h {
           from protocol bgp;
           then {
               as-path-prepend 64512;
               accept;
           }
       }
   }

:file:`bgpd.conf` for ``NVA 2`` on 192.168.1.101:

.. code-block:: frr

   router bgp 64512

       bgp router-id 192.168.1.101

       neighbor 192.168.1.100  remote-as 64512

       address-family ipv4 vpn
           neighbor 192.168.1.100 activate
       exit-address-family

       vnc nve-group group1
           prefix vn 172.16.0.0/17
           rd 64512:1
           response-lifetime 200
           rt both 1000:1 1000:2
       exit-vnc
   exit

:file:`bgpd.conf` for ``NVA 3`` on 192.168.1.102:

.. code-block:: frr

   router bgp 64512

       bgp router-id 192.168.1.102

       neighbor 192.168.1.100  remote-as 64512

       address-family ipv4 vpn
           neighbor 192.168.1.100 activate
       exit-address-family

       vnc defaults
           rd 64512:1
           response-lifetime 200
           rt both 1000:1 1000:2
       exit-vnc

       vnc nve-group group1
           prefix vn 172.16.128.0/17
       exit-vnc
   exit

VNC with Redundant Route Reflectors Configuration
-------------------------------------------------

This example combines the previous two
(:ref:`vnc-with-frr-route-reflector-config` and
:ref:`vnc-with-commercial-route-reflector-config`) into a redundant route
reflector configuration.  BGP route reflectors ``BGP Route Reflector 1`` and
``Commercial Router`` are the route reflectors for NVAs ``NVA 2`` and ``NVA
3``.  The two NVAs have connections to both route reflectors.

.. figure:: ../figures/fig-vnc-redundant-route-reflectors.png
   :align: center
   :alt: Redundant Route Reflectors

   FRR-based NVA with redundant route reflectors

:file:`bgpd.conf` for ``BPGD Route Reflector 1`` on 192.168.1.100:

.. code-block:: frr

   router bgp 64512

    bgp router-id 192.168.1.100
    bgp cluster-id 192.168.1.100

    neighbor 192.168.1.104 remote-as 64512

    neighbor 192.168.1.101 remote-as 64512
    neighbor 192.168.1.101 description iBGP-client-192-168-1-101
    neighbor 192.168.1.101 route-reflector-client

    neighbor 192.168.1.102 remote-as 64512
    neighbor 192.168.1.102 description iBGP-client-192-168-1-102
    neighbor 192.168.1.102 route-reflector-client

    address-family ipv4 vpn
     neighbor 192.168.1.101 activate
     neighbor 192.168.1.102 activate
     neighbor 192.168.1.104 activate

     neighbor 192.168.1.101 route-reflector-client
     neighbor 192.168.1.102 route-reflector-client
    exit-address-family
   exit

:file:`bgpd.conf` for ``NVA 2`` on 192.168.1.101:

.. code-block:: frr

   router bgp 64512

    bgp router-id 192.168.1.101

    neighbor 192.168.1.100  remote-as 64512
    neighbor 192.168.1.104  remote-as 64512

    address-family ipv4 vpn
     neighbor 192.168.1.100 activate
     neighbor 192.168.1.104 activate
    exit-address-family

    vnc nve-group group1
     prefix vn 172.16.0.0/17
     rd 64512:1
     response-lifetime 200
     rt both 1000:1 1000:2
    exit-vnc
   exit

:file:`bgpd.conf` for ``NVA 3`` on 192.168.1.102:

.. code-block:: frr

   router bgp 64512

    bgp router-id 192.168.1.102

    neighbor 192.168.1.100  remote-as 64512
    neighbor 192.168.1.104  remote-as 64512

    address-family ipv4 vpn
     neighbor 192.168.1.100 activate
     neighbor 192.168.1.104 activate
    exit-address-family

    vnc defaults
     rd 64512:1
     response-lifetime 200
     rt both 1000:1 1000:2
    exit-vnc

    vnc nve-group group1
     prefix vn 172.16.128.0/17
    exit-vnc
   exit

:file:`bgpd.conf` for the Commercial Router route reflector on 192.168.1.104:::

   routing-options {
       rib inet.0 {
           static {
               route 172.16.0.0/16 next-hop 192.168.1.104;
           }
       }
       autonomous-system 64512;
       resolution {
           rib inet.3 {
               resolution-ribs inet.0;
           }
           rib bgp.l3vpn.0 {
               resolution-ribs inet.0;
           }
       }
   }
   protocols {
       bgp {
           advertise-inactive;
           family inet {
               labeled-unicast;
           }
          group 1 {
               type internal;
               advertise-inactive;
               advertise-peer-as;
               import h;
               family inet {
                   unicast;
               }
               family inet-vpn {
                   unicast;
               }
               cluster 192.168.1.104;
               neighbor 192.168.1.101;
               neighbor 192.168.1.102;
           }

          group 2 {
               type internal;
               advertise-inactive;
               advertise-peer-as;
               import h;
               family inet {
                   unicast;
               }
               family inet-vpn {
                   unicast;
               }
               neighbor 192.168.1.100;
           }

       }
   }
   policy-options {
       policy-statement h {
           from protocol bgp;
           then {
               as-path-prepend 64512;
               accept;
           }
       }
   }

.. [#] The nve-id is carried in the route distinguisher. It is the second octet
       of the eight-octet route distinguisher generated for Ethernet / L2
       advertisements. The first octet is a constant 0xFF, and the third
       through eighth octets are set to the L2
       ethernet address being advertised.