summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_evpn_vty.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index a1b9e6e6a6..8556a325bb 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -604,7 +604,7 @@ static void show_esi_routes(struct bgp *bgp,
json_object_int_add(json, "numPaths", path_cnt);
} else {
if (prefix_cnt == 0)
- vty_out(vty, "No EVPN prefixes exist for this ESI");
+ vty_out(vty, "No EVPN prefixes exist for this ESI\n");
else
vty_out(vty, "\nDisplayed %u prefixes (%u paths)\n",
prefix_cnt, path_cnt);
@@ -4231,6 +4231,12 @@ DEFUN (bgp_evpn_vni_rd,
if (!bgp || !vpn)
return CMD_WARNING;
+ if (bgp->vrf_id != VRF_DEFAULT) {
+ vty_out(vty,
+ "This command is only supported under Default VRF\n");
+ return CMD_WARNING;
+ }
+
ret = str2prefix_rd(argv[1]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
@@ -4261,6 +4267,12 @@ DEFUN (no_bgp_evpn_vni_rd,
if (!bgp || !vpn)
return CMD_WARNING;
+ if (bgp->vrf_id != VRF_DEFAULT) {
+ vty_out(vty,
+ "This command is only supported under Default VRF\n");
+ return CMD_WARNING;
+ }
+
ret = str2prefix_rd(argv[2]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
@@ -4295,6 +4307,12 @@ DEFUN (no_bgp_evpn_vni_rd_without_val,
if (!bgp || !vpn)
return CMD_WARNING;
+ if (bgp->vrf_id != VRF_DEFAULT) {
+ vty_out(vty,
+ "This command is only supported under Default VRF\n");
+ return CMD_WARNING;
+ }
+
/* Check if we should disallow. */
if (!is_rd_configured(vpn)) {
vty_out(vty, "%% RD is not configured for this VNI\n");
@@ -4618,6 +4636,12 @@ DEFUN (bgp_evpn_vni_rt,
if (!bgp || !vpn)
return CMD_WARNING;
+ if (bgp->vrf_id != VRF_DEFAULT) {
+ vty_out(vty,
+ "This command is only supported under Default VRF\n");
+ return CMD_WARNING;
+ }
+
if (!strcmp(argv[1]->text, "import"))
rt_type = RT_TYPE_IMPORT;
else if (!strcmp(argv[1]->text, "export"))
@@ -4680,6 +4704,12 @@ DEFUN (no_bgp_evpn_vni_rt,
if (!bgp || !vpn)
return CMD_WARNING;
+ if (bgp->vrf_id != VRF_DEFAULT) {
+ vty_out(vty,
+ "This command is only supported under Default VRF\n");
+ return CMD_WARNING;
+ }
+
if (!strcmp(argv[2]->text, "import"))
rt_type = RT_TYPE_IMPORT;
else if (!strcmp(argv[2]->text, "export"))
@@ -4773,6 +4803,12 @@ DEFUN (no_bgp_evpn_vni_rt_without_val,
if (!bgp || !vpn)
return CMD_WARNING;
+ if (bgp->vrf_id != VRF_DEFAULT) {
+ vty_out(vty,
+ "This command is only supported under Default VRF\n");
+ return CMD_WARNING;
+ }
+
if (!strcmp(argv[2]->text, "import")) {
rt_type = RT_TYPE_IMPORT;
} else if (!strcmp(argv[2]->text, "export")) {