From f0d464083bf623547b2808638df50117a910f793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joey=20Julian=20K=C3=B6nig?= <31798580+netfreak98@users.noreply.github.com> Date: Fri, 30 Apr 2021 14:04:22 +0200 Subject: [PATCH 1/5] Update main.go Added NextHopSelf control option per peer --- internal/config/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/config/main.go b/internal/config/main.go index 54212dc0..7ade5a68 100644 --- a/internal/config/main.go +++ b/internal/config/main.go @@ -58,6 +58,8 @@ type Peer struct { Listen string `yaml:"listen" json:"listen" toml:"Listen"` MaxPfxAction string `yaml:"max-prefix-action" json:"max-prefix-action" toml:"MaxPrefixAction"` NoPeeringDB bool `yaml:"no-peeringdb" json:"no-peeringdb" toml:"NoPeeringDB"` + NextHopSelf bool `yaml:"next-hop-self" json:"next-hop-self" toml:"NextHopSelf"` + QueryTime string `yaml:"-" json:"-" toml:"-"` Name string `yaml:"-" json:"-" toml:"-"` From 51879a4e76d780070540baccb7883a631e25924e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joey=20Julian=20K=C3=B6nig?= <31798580+netfreak98@users.noreply.github.com> Date: Fri, 30 Apr 2021 14:08:22 +0200 Subject: [PATCH 2/5] Update peer.tmpl --- templates/peer.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/peer.tmpl b/templates/peer.tmpl index c04c3061..46869198 100644 --- a/templates/peer.tmpl +++ b/templates/peer.tmpl @@ -44,7 +44,7 @@ protocol bgp {{ $peer.Name }}v{{ $af }}_{{ $i }} { import keep filtered; {{ end -}} import limit AS{{ $peer.Asn }}_{{ $peer.Name }}_MAXPFX_v{{ $af }} action {{ $peer.MaxPfxAction }}; - {{ if eq $peer.Asn $global.Asn }}next hop self;{{ end }} + {{ if eq $peer.Asn $global.Asn || $peer.NextHopSelf == 1 }}next hop self;{{ end }} import filter { {{ if not $peer.SkipFilter }}reject_bogons();{{ end }} {{ if $peer.EnforceFirstAs }}enforce_first_as({{ $peer.Asn }});{{ end }} From da05da965224d6296eb8805a03d5ef1e52db08c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joey=20Julian=20K=C3=B6nig?= <31798580+netfreak98@users.noreply.github.com> Date: Fri, 30 Apr 2021 14:31:23 +0200 Subject: [PATCH 3/5] Update README.md updated doc --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index abdb6514..b09b1127 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,7 @@ bcg uses RFC 8092 BGP Large Communities | description | Description string (just for human reference) | | max-prefix-action | Max prefix violation action | | no-peeringdb | Don't query PeeringDB for peering information | +| next-hop-self | Enable "next hop self;" for specifix peers | #### VRRP instance config options From f021117617fc0a6fe7803e966fe911f0f97bcf5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joey=20Julian=20K=C3=B6nig?= <31798580+netfreak98@users.noreply.github.com> Date: Fri, 30 Apr 2021 18:07:03 +0200 Subject: [PATCH 4/5] Update peer.tmpl --- templates/peer.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/peer.tmpl b/templates/peer.tmpl index 46869198..b33dd450 100644 --- a/templates/peer.tmpl +++ b/templates/peer.tmpl @@ -44,7 +44,7 @@ protocol bgp {{ $peer.Name }}v{{ $af }}_{{ $i }} { import keep filtered; {{ end -}} import limit AS{{ $peer.Asn }}_{{ $peer.Name }}_MAXPFX_v{{ $af }} action {{ $peer.MaxPfxAction }}; - {{ if eq $peer.Asn $global.Asn || $peer.NextHopSelf == 1 }}next hop self;{{ end }} + {{ if eq $peer.Asn $global.Asn || $peer.NextHopSelf }}next hop self;{{ end }} import filter { {{ if not $peer.SkipFilter }}reject_bogons();{{ end }} {{ if $peer.EnforceFirstAs }}enforce_first_as({{ $peer.Asn }});{{ end }} From 32531cdcc7381638de50493586dbf6595d3913c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joey=20Julian=20K=C3=B6nig?= <31798580+netfreak98@users.noreply.github.com> Date: Fri, 30 Apr 2021 18:07:29 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b09b1127..c4be6244 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ bcg uses RFC 8092 BGP Large Communities | description | Description string (just for human reference) | | max-prefix-action | Max prefix violation action | | no-peeringdb | Don't query PeeringDB for peering information | -| next-hop-self | Enable "next hop self;" for specifix peers | +| next-hop-self | Enable "next hop self;" for specific peers | #### VRRP instance config options