summaryrefslogtreecommitdiffhomepage
path: root/gobgpd/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'gobgpd/main.go')
-rw-r--r--gobgpd/main.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go
index fdfb8cca..9b504441 100644
--- a/gobgpd/main.go
+++ b/gobgpd/main.go
@@ -188,6 +188,31 @@ func main() {
log.Fatalf("failed to set bmp config: %s", err)
}
}
+ for _, vrf := range newConfig.Vrfs {
+ rd, err := bgp.ParseRouteDistinguisher(vrf.Config.Rd)
+ if err != nil {
+ log.Fatalf("failed to load vrf rd config: %s", err)
+ }
+ importRtList := make([]bgp.ExtendedCommunityInterface, 0, len(vrf.Config.ImportRtList))
+ for _, rtString := range vrf.Config.ImportRtList {
+ rt, err := bgp.ParseRouteTarget(rtString)
+ if err != nil {
+ log.Fatalf("failed to load vrf import rt config: %s", err)
+ }
+ importRtList = append(importRtList, rt)
+ }
+ exportRtList := make([]bgp.ExtendedCommunityInterface, 0, len(vrf.Config.ExportRtList))
+ for _, rtString := range vrf.Config.ExportRtList {
+ rt, err := bgp.ParseRouteTarget(rtString)
+ if err != nil {
+ log.Fatalf("failed to load vrf export rt config: %s", err)
+ }
+ exportRtList = append(exportRtList, rt)
+ }
+ if err := bgpServer.AddVrf(vrf.Config.Name, vrf.Config.Id, rd, importRtList, exportRtList); err != nil {
+ log.Fatalf("failed to set vrf config: %s", err)
+ }
+ }
for i, _ := range newConfig.MrtDump {
if len(newConfig.MrtDump[i].Config.FileName) == 0 {
continue