From efc9b57d223639601d5e618610fa0c08688353b8 Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Sat, 23 Jul 2022 19:58:58 +0200 Subject: [PATCH] bgpd: add per-VRF SID to the bgpd configuration This commit adds the per-VRF SID chosen to advertise L3VPN for IPv4 and IPv6 address families using a single SID to the bgpd configuration. Signed-off-by: Carmine Scarpitta --- bgpd/bgp_vty.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 8566dba54b..427ad1b332 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -17667,6 +17667,7 @@ int bgp_config_write(struct vty *vty) struct listnode *mnode, *mnnode; afi_t afi; safi_t safi; + uint32_t tovpn_sid_index = 0; if (bm->rmap_update_timer != RMAP_DEFAULT_UPDATE_TIMER) vty_out(vty, "bgp route-map delay-timer %u\n", @@ -18051,6 +18052,13 @@ int bgp_config_write(struct vty *vty) vty_endframe(vty, " exit\n"); } + tovpn_sid_index = bgp->tovpn_sid_index; + if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_TOVPN_SID_AUTO)) { + vty_out(vty, " sid vpn per-vrf export auto\n"); + } else if (tovpn_sid_index != 0) { + vty_out(vty, " sid vpn per-vrf export %d\n", + tovpn_sid_index); + } /* IPv4 unicast configuration. */ bgp_config_write_family(vty, bgp, AFI_IP, SAFI_UNICAST); -- 2.39.5