From ed622ddbe1d5fc3434471fae317f74693b8db8e5 Mon Sep 17 00:00:00 2001 From: Nate Sales Date: Sat, 20 Mar 2021 18:34:21 -0700 Subject: [PATCH] revert to single static protocol definition --- templates/global.tmpl | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/templates/global.tmpl b/templates/global.tmpl index bbee1f2d..9aff3e87 100644 --- a/templates/global.tmpl +++ b/templates/global.tmpl @@ -8,11 +8,17 @@ router id {{ .RouterId }}; define LOCAL_v4 = [ {{ BirdSet .OriginSet4 }} ]; +{{- end }} + +{{if or .Static4 .OriginSet6 }} protocol static static4 { ipv4; {{- range $i, $prefix := .OriginSet4 }} route {{ $prefix }} reject; {{- end }} + {{- range $prefix, $nexthop := .Static4 }} + route {{ $prefix }} via {{ $nexthop }}; + {{- end }} } {{- end }} @@ -20,26 +26,14 @@ protocol static static4 { define LOCAL_v6 = [ {{ BirdSet .OriginSet6 }} ]; +{{- end }} + +{{if or .Static4 .OriginSet6 }} protocol static static6 { ipv6; {{- range $i, $prefix := .OriginSet6 }} route {{ $prefix }} reject; {{- end }} -} -{{- end }} - -{{ if .Static4 -}} -protocol static explstatic4 { - ipv4; - {{- range $prefix, $nexthop := .Static4 }} - route {{ $prefix }} via {{ $nexthop }}; - {{- end }} -} -{{- end }} - -{{ if .Static6 -}} -protocol static explstatic6 { - ipv6; {{- range $prefix, $nexthop := .Static6 }} route {{ $prefix }} via {{ $nexthop }}; {{- end }}