mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 12:49:18 +00:00
bgpd: write vrf import/export RT config to frr.conf
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
This commit is contained in:
parent
e92bd2a28b
commit
41d6d607b7
34
bgpd/bgpd.c
34
bgpd/bgpd.c
@ -78,7 +78,7 @@
|
|||||||
#include "bgpd/bgp_evpn_vty.h"
|
#include "bgpd/bgp_evpn_vty.h"
|
||||||
#include "bgpd/bgp_keepalives.h"
|
#include "bgpd/bgp_keepalives.h"
|
||||||
#include "bgpd/bgp_io.h"
|
#include "bgpd/bgp_io.h"
|
||||||
|
#include "bgpd/bgp_ecommunity.h"
|
||||||
|
|
||||||
DEFINE_MTYPE_STATIC(BGPD, PEER_TX_SHUTDOWN_MSG, "Peer shutdown message (TX)");
|
DEFINE_MTYPE_STATIC(BGPD, PEER_TX_SHUTDOWN_MSG, "Peer shutdown message (TX)");
|
||||||
DEFINE_QOBJ_TYPE(bgp_master)
|
DEFINE_QOBJ_TYPE(bgp_master)
|
||||||
@ -7304,6 +7304,38 @@ int bgp_config_write(struct vty *vty)
|
|||||||
if (bgp_option_check(BGP_OPT_CONFIG_CISCO))
|
if (bgp_option_check(BGP_OPT_CONFIG_CISCO))
|
||||||
vty_out(vty, " no auto-summary\n");
|
vty_out(vty, " no auto-summary\n");
|
||||||
|
|
||||||
|
/* import route-target */
|
||||||
|
if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_IMPORT_RT_CFGD)) {
|
||||||
|
char *ecom_str;
|
||||||
|
struct listnode *node, *nnode;
|
||||||
|
struct ecommunity *ecom;
|
||||||
|
|
||||||
|
for (ALL_LIST_ELEMENTS(bgp->vrf_import_rtl, node, nnode,
|
||||||
|
ecom)) {
|
||||||
|
ecom_str = ecommunity_ecom2str(
|
||||||
|
ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
||||||
|
vty_out(vty, " route-target import %s\n",
|
||||||
|
ecom_str);
|
||||||
|
XFREE(MTYPE_ECOMMUNITY_STR, ecom_str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* export route-target */
|
||||||
|
if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_EXPORT_RT_CFGD)) {
|
||||||
|
char *ecom_str;
|
||||||
|
struct listnode *node, *nnode;
|
||||||
|
struct ecommunity *ecom;
|
||||||
|
|
||||||
|
for (ALL_LIST_ELEMENTS(bgp->vrf_export_rtl, node, nnode,
|
||||||
|
ecom)) {
|
||||||
|
ecom_str = ecommunity_ecom2str(
|
||||||
|
ecom, ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
||||||
|
vty_out(vty, " route-target export %s\n",
|
||||||
|
ecom_str);
|
||||||
|
XFREE(MTYPE_ECOMMUNITY_STR, ecom_str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* IPv4 unicast configuration. */
|
/* IPv4 unicast configuration. */
|
||||||
bgp_config_write_family(vty, bgp, AFI_IP, SAFI_UNICAST);
|
bgp_config_write_family(vty, bgp, AFI_IP, SAFI_UNICAST);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user