as = bgp_def->as;
/* if the BGP vrf instance doesnt exist - create one */
- bgp_vrf = bgp_lookup_by_vrf_id(vrf_id);
+ bgp_vrf = bgp_lookup_by_name(vrf_id_to_name(vrf_id));
if (!bgp_vrf) {
int ret = 0;
*/
}
+ /* unset the auto created flag as the user config is now present */
+ UNSET_FLAG(bgp->vrf_flags, BGP_VRF_AUTO);
VTY_PUSH_CONTEXT(BGP_NODE, bgp);
return CMD_SUCCESS;
"%% Multiple BGP processes are configured\n");
return CMD_WARNING_CONFIG_FAILED;
}
+
+ if (bgp->l3vni) {
+ vty_out(vty, "%% Please unconfigure l3vni %u",
+ bgp->l3vni);
+ return CMD_WARNING_CONFIG_FAILED;
+ }
} else {
as = strtoul(argv[idx_asn]->arg, NULL, 10);
vty_out(vty, "%% Can't find BGP instance\n");
return CMD_WARNING_CONFIG_FAILED;
}
+
+ if (bgp->l3vni) {
+ vty_out(vty, "%% Please unconfigure l3vni %u",
+ bgp->l3vni);
+ return CMD_WARNING_CONFIG_FAILED;
+ }
}
bgp_delete(bgp);
/* BGP configuration. */
for (ALL_LIST_ELEMENTS(bm->bgp, mnode, mnnode, bgp)) {
+
+ /* skip all auto created vrf as they dont have user config */
+ if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO))
+ continue;
+
/* Router bgp ASN */
vty_out(vty, "router bgp %u", bgp->as);